title: Java: How to split a string by a number of characters?
body: <p>I tried to search online to solve this question but I didn't found anything.</p>
  
  <p>I wrote the following abstract code to explain what I'm asking:</p>
  
  <pre><code>String text = "how are you?";
  
  String[] textArray= text.splitByNumber(4); //this method is what I'm asking
  textArray[0]; //it contains "how "
  textArray[1]; //it contains "are "
  textArray[2]; //it contains "you?"
  </code></pre>
  
  <p>The method splitByNumber splits the string "text" every 4 characters. How I can create this method??</p>
  
  <p>Many Thanks</p>