This content has been marked as final. Show 7 replies
Are you saying you wish to tokenise strings like the following?
If not please be more specific as to what you are trying to achieve.
Thx for replying
If a string is like
so i want abc de fg hijk
I hope you got my point.
This one works for me, what did you get ?
StringTokenizer st = new StringTokenizer("abc**de**fg**hijk**" , "**");
If you are going to have **, ++ and -- all in one string then you will have to use a regular expression and the split method.
I'm note sure about that but
my delimiters should be
* for multiply
/ for division
+ for addition
- for subtraction
** for exponential
and I guess multiply and exponential make a problem I think..
Is this what you want ?
StringTokenizer st = new StringTokenizer("a+b-c*d/e**f" , "+|-|*|/");