I have the following input (11,C) (5,) (7,AB) I need to split them into 2 part for each coordinates. So my intarray should have 11, 5, 7 and my letter array should have C,,AB
But when I try using stringtokenizer, I only get my intarray should have 11, 5, 7 and my letter array should have C,AB
Is there any way I could get the empty part of (5,)? Thank you.
Vector<String> points = new Vector<String> (); String a = "(11,C) (5,) (7,AB)"; StringTokenizer st = new StringTokenizer(a, "(,)"); while(st.hasMoreTokens()) { points.add(st.nextToken()); } } System.out.println(points);