title: JAVA - Double split string and convert to integer
body: <p>Hello i tried many ways to complete this but i failed.
  Could you help me ?
  I need double split one is "\n" and second is "|".
  In textArea is string 
  350|450\n
  444|452\n
  and so one.
  There are mouse coordinates.
  X|Y
  in int array i need </p>
  
  <pre><code>array[0]= x coord;
  array[1]= y coord;
  array[2]= x coord;
  array[2]= y coord;
  </code></pre>
  
  <p>So i have string in textarea.I split that by "\n"</p>
  
  <pre><code>String s[]= txtArea.getText().split("\\n");
  </code></pre>
  
  <p>This is one split and in textarea i have something like 150|255 
  this is my mouse coordinates x|y.
  So i need next split "|".</p>
  
  <pre><code>String s2[] = s[i].split("|");
  </code></pre>
  
  <p>After that </p>
  
  <pre><code>int [] array = new [s.length*2];
  </code></pre>
  
  <p>And some method for</p>
  
  <pre><code>while(!(s[j].equals("|")))
  array[i] = Integer.parseInt(s[j]);
  </code></pre>
  
  <p>I tried something like that-</p>
  
  <pre><code>for(String line : txtArea.getText().split("\\n")){
              arrayXY = line.split("\\|");
              array = new int[arrayXY.length];
          }
  </code></pre>
  
  <p>Thank you a lot for answers :)
  Have a nice day.</p>