How do I separate tokens in a StringToekenizer object taking a string s as a parameter?
so:
String s = input.readLine();
char tokenSeparator = ' '; //can be any value other than white space.
StringTokenizer str = new StringTokenizer(s);
//separate tokens by the variable char tokenSeparator;
while (str.hasMoreTokens) ...
Check the javadoc. You can see a parameterized constructor as
This is what you require here.
Example
Output