Java StringTokenizer trouble ... help!
I'm having a problem with the StringTokenizer ...
The input i am supplying is:
Oklahoma City, OK: 12:24
And the output i want is:
12:24 Oklahoma City OK
But for the outputs, all i'm getting is:
12 Oklahoma City OK
My question is ... how do i make it so that the token doesnt end at the : inbetween 12 and 24, but so that it ends after the 24??
here is the code i'm using...
StringTokenizer tok = new StringTokenizer(firstLineFinal);
String city = tok.nextToken(",");
String state = tok.nextToken(", :");
String time = tok.nextToken(": \n");
System.out.println(time + " " + city + " " + state);
Thanks in advance...