Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java in General and the fly likes difference between using tokenizing, split Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "difference between using tokenizing, split " Watch "difference between using tokenizing, split " New topic
Author

difference between using tokenizing, split

avishek bose
Greenhorn

Joined: Oct 12, 2011
Posts: 15
hi ,

Ca anyone tell me the difference between the tokenzer and split() applied to string and when to use them

regards
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8008
    
  22

avishek bose wrote:Ca anyone tell me the difference between the tokenzer and split() applied to string and when to use them

This from the StringTokenizer class API documentation:
"StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String or the java.util.regex package instead."

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
 
 
subject: difference between using tokenizing, split