Java split string from array
<p>I have a string array that contains some information.</p>

<p>Example: </p>

<pre><code> String [] testStringArray;

 testStringArray[0]= Jim,35
                     Alex,45 
                     Mark,21

 testStringArray[1]= Ana,18
                    Megan,44
</code></pre>

<p>This is exactly how the information is. Now my problem is I want to make each element a seperate element in an array and I want to split it based on the \n character.</p>

<p>So I want </p>

<pre><code>        newArray[0]=Jim,35
        newArray[1]=Alex,45
        newArray[2]=Mark,21
        newArray[3]=Ana,18
</code></pre>

<p>etc etc. I am aware of the split method but won't this just split each array element into a completely new array instead of combining them?</p>

<p>If anyone could help, it would be appreciated. Thanks</p>
