title: splitting string in java into fixed length chunks
body: <p>I have seven strings in a program named string1 through string7.</p>
  
  <p>The size of each of the string will be 30 characters. </p>
  
  <p>I will get a input string of unknown length. </p>
  
  <p>I have to split this input string in 30 char strings and then set first substring into string1, 2nd in string2 and so on until possible. If input string is greater then 210 characters then remaining string at the end will be ignored. </p>
  
  <p>How to handle the case when the input string is of size smaller then 210 char. </p>
  
  <p>For e.g. 145 in which case string1 through string4 will be full and string5 will be made of remaining 15 char. </p>
  
  <p>How to handle this nicely ?</p>
  
  <p>I can do it reading char by char and putting first 30 char and string1, next in string2, etc until all char are consumed. </p>
  
  <p>But is there a better way to do this ?</p>