0

hi

i want to break the following string..

{ok,[{operators,'sri','mob',45,45,45,45},{operators,'sri','dia',45,45,45,45}]}


by using {operators, this point..

i used the StringTokenizer class to do this by giving the {operators, as Delimiter.

But when it runs it gives completely different result than I expected
that is it was matched any character that the delimiter include..


So please anyone can help me to do this


3
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by rpjanaka
0

Can you please provide code.... <== was my original message

LOL iamthwee beaten me for faster response, good link which you provided

0
public void tokenize(){
    StringTokenizer tokenizer = new StringTokenizer("{ok,[{operators,'sri','mob',45,45,45,45},{operators,'sri','dia',45,45,45,45}]}"
                                                    ,"[COLOR=Red]{operators,[/COLOR]");
   while(tokenizer.hasMoreTokens()){
     System.out.println(tokenizer.nextToken());
   }

  }

the above is the cord

Edited by happygeek: fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.