View Single Post
  #9 (permalink)  
Old 04-10-2008, 12:13 PM
DonCash's Avatar
DonCash DonCash is offline
Moderator
 
Join Date: Aug 2007
Location: London, UK
Posts: 239
DonCash will become famous soon enoughDonCash will become famous soon enough
Quote:
Use String.split() method. It can take array of strings as arguments. StringTokenizer can/may be deprecated in the present/future releases.
Yes game I agree. I didn't even think anyone used StringTokenizer anymore!

Here is a quick example of the Split method:

Code:
String myString = "a||b||c"; String[] split = myString.split("||"); System.out.println(split[1]+","+split[4]+","+split[7]);
Output:
Code:
a,b,c
__________________
Did this post help you? Please
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
me!

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote