How can I read an email address as a token?
I saw that the tokenizer method has a limit of 16 bits of length, well my token is like this:
command emailtest@somewhere.com 50
I want to be able to store the email (can be any email address) and the number (can vary from 5-1500). I dont care about the command token.
My code looks like this:
String test2 = command.substring(7);
StringTokenizer st = new StringTokenizer(test2);
String email = st.nextToken();
String amount = st.nextToken();
So if you have your data in a variable called
commandyou could simply do:Alternatively, you can use “split” on the string to load it into an array: