|
-
Feb 12th, 2003, 02:46 AM
#1
Thread Starter
PowerPoster
[done] Split() in Java?
Hi folks, is there any Split() function in Java? The function should split up strings by a specified token and put each part in a string array. Thanks.
Last edited by Fox; Feb 12th, 2003 at 12:48 PM.
-
Feb 12th, 2003, 03:48 AM
#2
Code:
String toSplit = "Hello,World,!";
String split[] = toSplit.split(",");
for (int cnt = 0; cnt < split.length; cnt++)
{
System.out.println(split[cnt]);
}
-
Feb 12th, 2003, 11:55 AM
#3
You could also go with a StringTokenizer object.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 12th, 2003, 12:46 PM
#4
Thread Starter
PowerPoster
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|