splitting string
Hi,
I have 2 strings,string 1 and string 2 which r like
Id. Subject no of days
123 Java Learn 3
234 Computer Science 5
and Id, Subject and no. of days are separated by tabs (\t)
Now if i wish to extract subject, ie "java learn" from string 1 and "computer Science" from string 2 , how do it do it ?
[343 byte] By [
Sangfroida] at [2007-10-3 11:47:01]

String teststr = "Thisisastring";
String [] strArr = teststr.split("\t");
for(String b : strArr)
{
System.out.println(b);
}
String.split returns an array of String, not a String.
~Tim
Or to use your original problem
String teststr = "123Java Learn3";
String [] strArr = teststr.split("\t");
for(String b : strArr)
{
System.out.println(b);
}
//output
123
Java Learn
3
Message was edited by:
SomeoneElse