title: Java: New Line after 18 Chars & new Array Index after 13 Lines
body: <p>I am pretty new to Java and I have a little problem with formatting a String. I have add "\n" for a new line after every 18th char and I have to split these new lines into array indexes, 13 lines for each index.</p>
  
  <p>My code so far:</p>
  
  <pre><code>String[] strings = str.split("\n");
  String result;
  for (int i = 1; i &lt; strings.length; i++) {
      i++;
      if ((i % 13) == 0) {
          result += strings[i];
      } else {
          result += strings[i] + "\n";
      }
  }
  </code></pre>
  
  <p>It doesn't work as it should, I tested a bit around bit I don't know how to do this, could someone help me please?</p>