utilizza la classe StringTokenizer:
The following is one example of the use of the tokenizer. The code:

StringTokenizer st = new StringTokenizer("this is a test");
while (st.hasMoreTokens()) {
println(st.nextToken());
}


prints the following output:

this
is
a
test
è uno stralcio della documentazione.
ovviamente puoi anche definire tu il delimitatore