Posted By:
AlessandroA_Garbagnati
Posted On:
Saturday, May 31, 2003 02:33 PM
Ciao Pier Luigi,
The class you should use is
java.util.StringTokenizer and the
StringTokenizer JavaDoc does show you few examples on how to parse/split a string.
This is a simple example. I have written it "on the fly" so if there are errors, please do excuse me...
...
String str = "uno,due,tre,quattro";
StringTokenizer st = new StringTokenizer(str, ",");
String[] strArr = new String[st.countTokens();
int counter = 0;
while (st.hasMoreTokens()) {
strArr[counter++] = st.nextToken();
}
...