title: Best way to process strings in Java
body: <p>I want make a game of life clone using text files to specify my starting board, then write the finished board to a new text file in a similar format. E.g. load this:</p>
  
  <p>Board in:</p>
  
  <pre>
  wbbbw
  bbbbb
  wwwww
  wbwbw
  bwbwb
  </pre>
  
  <p>from a file, then output something like this:</p>
  
  <p>Board out:</p>
  
  <pre>
  wbbbw
  bbbbb
  wwwww
  wwwww
  bwbwb
  </pre>
  
  <p>I do this by making a 2D array (<code>char[][] board</code>) of characters, reading the file line by line into a string, and using <code>String.charAt()</code> to access each character and store it in the array.</p>
  
  <p>Afterward, I convert each element of board (i.e., <code>board[0]</code>, <code>board[1]</code>, etc.), back to a string using <code>String.valueOf()</code>, and write that to a new line in the second file.</p>
  
  <p>Please tell me I'm an idiot for doing this and that there is a better way to go through the file -> string -> array -> string -> file process.</p>