
/*
Online Java - IDE, Code Editor, Compiler

Online Java is a quick and easy tool that helps you to build, compile, test your programs online.
*/

public class Main
{
    public static void main(String[] args) {
        System.out.println("Welcome to Online IDE!! Happy Coding :)");
        
        String sample = "the quick brown fox jumps over the laxy dog";
        String sample1="ther";
        int lengthLine = 10;
        
        stringExercise  se = new stringExercise(sample, lengthLine);
        
        
            }
}


class stringExercise
{
    private String sample;
    private int lengthLine;
    
    public stringExercise(String sample, int lengthLine)
    {
        this.sample=sample;
        this.lengthLine=lengthLine;
        
        checkString();
        
        
        
    }
    
    public String checkString()
    {
        
        //no way to break the text;
        if ((sample.length()>=lengthLine) &&  (sample.indexOf(" ")==-1))
            {
                return null;
                
            }
        
        //this narrows down search and it would find     
        if (sample.length()<lengthLine)
        {
            return sample;
            
        }
        
        if ((sample.length()>=lengthLine) &&  (sample.indexOf(" ")!=-1))
            {
                System.out.println("should reach here");
                return null;
                
                // this now counts how many strings are required to store the values
                
            }
        
        
        return null;
        
    }
    
}
