|
-
Jan 20th, 2002, 09:06 PM
#1
Thread Starter
Member
Strings, strings, strings [resolved]
Let's say I have a String that contains "Line 1\nLine 2\nLine 3". How could I make it so s[0] = "Line 1", s[1] = "Line 2", etc? In VB it would be:
VB Code:
SomeStringArray = Split(TheBigString, vbCrLf)
Last edited by filburt1; Jan 20th, 2002 at 10:57 PM.
-
Jan 20th, 2002, 10:50 PM
#2
I would just use a StringTokenizer
Code:
private void runThrough(String str, String delim)
{
StringTokenizer st = new StringTokenizer(str,delim)
while(st.hasMoreTokens())
{
System.out.println(st.nextToken());
}
}
Does it need to be an array?
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Jan 20th, 2002, 10:56 PM
#3
Thread Starter
Member
Yeah, but I can get the rest.
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
|