For example, Ive got Some stringa.b.c.d`, I have separated it by tokens. but now I want to do a specific thing with a, then something else with b, and something else with c. How can I do that?
String value="a.b.c.d"; StringTokenizer tokenize = new StringTokenizer(value, "."); while(tokenize.hasMoreTokens()){ String separated1= tokenize.?????; String separated2= tokenize.?????; String Val1 = someMethod1(separated1); String Val2 = someMethod2(separated2); } //tokenize next line is not solution
ifstatements one after the other to check if there is still a token and get the next token and do something with it.