How do I split strings in J2ME?

There are a few implementations of a StringTokenizer class for J2ME. This one by Ostermiller will most likely include the functionality you need

See also this page on Mobile Programming Pit Stop for some modifications and the following example:

String firstToken;
StringTokenizer tok;

tok = new StringTokenizer("some|random|data","|");
firstToken= tok.nextToken();

There is no built in method to split strings. You have to write it on your own using String.indexOf() and String.substring(). Not hard.


String.split(...) is available in J2SE, but not J2ME.
You are required to write your own algorithm: related post with sample solution.