esite un metodo che si chiama split nella classe String. Però è presente dal java 1.4 in su...

codice:
public String[] split(String regex)

The string "boo:and:foo", for example, yields the following results with these expressions:

Regex Result
: { "boo", "and", "foo" }
o { "b", "", ":and:f" }