This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The way out to avoid the problem is using the split() method of String class. Can some one discuss the problem in more details and provide some more alternatives about tokenizing and implementation of split().
In constructor of StringTokenizer(stringToSearch, delimiterString) , every char from delimiterString could be a delimiter, not whole delimiterString, so in case of "------" delimiter could be '-' or '-' and so on.So "----" is the same as "-". delimiterString "s1" means that delimiter will be 's' or '1'.