Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • 8
    Would also be interesting to see Scanner's results on the same tests you ran on String.Split and StringTokenizer. Commented Mar 27, 2009 at 20:09
  • 2
    Gave me an answer to another question: "why is use of StringTokenizer discouraged, as stated in the Java API notes?". From this text it seems that the answer would be "because String.split() is fast enough". Commented May 1, 2011 at 6:49
  • 2
    So is StringTokenizer pretty much deprecated now? Commented Mar 5, 2012 at 22:11
  • what to use instead of it? Scanner? Commented Jul 29, 2014 at 18:06
  • 4
    I realize it's an answer to an old question, but if I need to split a huge text stream into tokens on the fly, isn't StringTokenizer still my best bet because String.split() will simply run out of memory? Commented Jan 26, 2016 at 8:30