I have a String in the format first<-0
or i<-length
where the <-
is used instead of the assignment operator.
I want to break it in 3 parts i.e. left side, operator and right side.
Then store all 3 parts after tokenization.
The problem isn't storing the delimeters, I have already solved that by passing the 3rd parameter true
in constructor.
The issue is that the StringTokenizer
only works when the delimeter is 1 character long. Any work around this?
StringTokenizer tokens= new StringTokenizer("first<-0", "<-", true);