title: java scan coordinates as (X, Y) format
body: <p>How can I scan coordinates with <code>(x, y)</code> format? <br>
  For example: </p>
  
  <pre class="lang-none prettyprint-override"><code>(1, 3) 
  (2, 4)
  (4, 1)
  (3, 2)
  </code></pre>
  
  <p>What I've tried is this:</p>
  
  <pre><code>String m = input.next(); 
  String parts[] = m.split(","); 
  
  String part1 = parts[0]; 
  String part2 = parts[1]; 
  
  part1 = part1.substring(1, part1.length()); 
  part2 = part2.substring(0, part2.length()-1);
  </code></pre>
  
  <p>That code works for a coordinate with <code>(x,y)</code> format but doesn't work for <code>(x, y)</code></p>