string tokenizer question
I need to parse strings of the form "token A ops token B" where ops can be <, >, =, != and output "tokenA ops tokenB"....(remove spaces in the tokens).
I can use all the ops as delimiters (though I cant specify '!='), and get the tokens and remove the spaces in them. Using StringTokenizer, I doubt if I can know the exact delimiter I encountered so that I can rebuild the string quickly. Sure, I can do an indexOf() for each of the ops to find the one used in original string. But I am curious to know if there is any better approach to do this (doesnt have to be string tokenizer approach)?

