title: Looping through 2d array with String.split()
body: <p>I've got a simple problem, but I'm new to Java coming from PHP.  I need to split a delimited text file into an array.  I've broken it down into an array of lines, each one would look something like this:</p>
  
  <pre><code>{
      {Bob | Smithers | Likes Cats | Doesnt Like Dogs},
      {Jane | Haversham | Likes Bats | Doesnt Like People}
  }
  </code></pre>
  
  <p>I need to turn this into a 2 dimensional array.</p>
  
  <p>In PHP, it's a cinch.  You just use explode();  I tried using String.split on a 1d array and it wasn't that bad either.  The things is, I haven't yet learned how to be nice to Java.  So I don't know how to loop through the array and turn it into a 2d.  This is what I have:</p>
  
  <pre><code>for (i = 0; i &lt; array.length; i++) {
      String[i][] 2dArray = array[i].split("|", 4);
  }
  </code></pre>
  
  <p>PHP would be</p>
  
  <pre><code>for ($i = 0; $i &lt; count($array); $i++) {
      $array[i][] = explode(",", $array[i]);
  }
  </code></pre>