Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

StringTokenizer  RSS feed

 
Csaba Kassitzky
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone!
How does Stringtokenizer tokenize " "?
What about linebreaks? Do linebreaks also count(i use default tokenizer, no custom breakpoints)?
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the API, "The tokenizer uses the default delimiter set, which is " \t\n\r\f": the space character, the tab character, the newline character, the carriage-return character, and the form-feed character."

Also note that "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."

Ref: http://java.sun.com/j2se/1.5.0/docs/api/java/util/StringTokenizer.html
 
Kia Phia Ben
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this class to parse string. Token , you can define in string. You can download example about it in Internet.
 
Kia Phia Ben
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this class to parse string. Token , you can define in string. You can download example about it in Internet.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!