title: How do seperate and print a string every certain amount of characters?
body: <p>write a static method called wordWrap that accepts a String as a parameter, and prints it to the console. 
  It is required that each line should have 7characters except that the last line 
  can have less than 7 characters.</p>
  
  <p>Create a String “Test the java codes of WordWrap.”. Call wordWrap on the String.</p>
  
  <blockquote>
    <p>output</p>
    
    <p>Test th<br>
    e java<br>
    codes o<br>
    f Word<br>
    rap.    </p>
  </blockquote>
  
  <p>This is the code I have so far.</p>
  
  <pre><code>public class WordWrap 
  {
      public static void main(String[] args) 
      {
          String x = "Test the java codes of WordWrap.";
          wordwrap(x);
      }
      public static void wordwrap(String input1) 
  {
      While(input1.length()&gt;7)
      {
          System.out.println(input1.substring(0,8));
          input1 = input1.substring(8,input1.length());
      }
      System.out.println(input1.substring(0,input1.length()));
  }
  }
  
  /*public static void wordwrap(String input1) 
  {
  While(input1 &gt; 7);
  System.out.println(input1.substring(0, 7));
  System.out.println(input1.substring(8, 14));
  System.out.println(input1.substring(15, 21));
  
  }
  }*/
  </code></pre>