V
vic
Hi All,
I have a string x=RECORD(1) state:xx city:yyyyyy zip:12345
how would i go about so that i can derive the values for state, city
and zip and store it in a new string . i did try and use
stringtokenizer but could get it to work. Am i missing something.
here is what i tried
String tstate = " ";
String tcity = " ";
String tzip = " ";
StringTokenizer str = new StringTokenizer(x, ":");
while(str.hasMoreTokens()) {
tstate = str.nextToken(":");
tcity = str.nextToken(":");
tzip = str.nextToken(":");
}
Any help appreciated
Thanks
vic
I have a string x=RECORD(1) state:xx city:yyyyyy zip:12345
how would i go about so that i can derive the values for state, city
and zip and store it in a new string . i did try and use
stringtokenizer but could get it to work. Am i missing something.
here is what i tried
String tstate = " ";
String tcity = " ";
String tzip = " ";
StringTokenizer str = new StringTokenizer(x, ":");
while(str.hasMoreTokens()) {
tstate = str.nextToken(":");
tcity = str.nextToken(":");
tzip = str.nextToken(":");
}
Any help appreciated
Thanks
vic