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)
Printable View
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)
I would just use a StringTokenizer
Does it need to be an array?Code:private void runThrough(String str, String delim)
{
StringTokenizer st = new StringTokenizer(str,delim)
while(st.hasMoreTokens())
{
System.out.println(st.nextToken());
}
}
:)
Yeah, but I can get the rest. :)