Look at the Sun API Documentation for:
* java.lang.String
* java.lang.StringBuffer
* java.util.StringTokenizer
To simply split a String up into parts (sub
strings) the java.lang.String API is all you will need.
The purpose of java.util.StringTokenizer is to
allow you to get token separated parts of a String.
e.g. The folowing code extracts the comma
separated sub-strings Strings from a String
and places them in a Vector. The commas are not
part of the extracted sub-strings.
String theString =
"cat,dog,elephant,mother,rabbit";
StringTokenizer sT = new StringTokenizer(theString,
',');
Vector substrings = new Vector();
while (sT.hasMoreTokens()) { vec.addElement(st.nextToken().trim()); } ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤øø
Miles Daffin
Java Developer, Netherlands. ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤øø
|
- Splitting a string? Winnie Cheung
- Re: Splitting a string? Miles Daffin
- Re: Splitting a string? Wyn Easton