Hi i have a string looking something like this 10 -1 30 -2 and i want to read the numbers between spaces. I can do this using a FOR statement and the code
Maybe you want to use a StringTokenizer to split the String at certain characters.
StringTokenizer st = new StringTokenizer("10 -1 30 -2");
while (st.hasMoreTokens()) {
String intStr = st.nextToken();
int x = Integer.parseInt(intStr);
System.out.println(x);
}