Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

StringTokenizer

 
viral trivedi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a string with ";" as a delimiter. Everytime i parse this string via nextTokens of a string tokenizer it fetches the next as it says. How can i get to print every token rahter than alternate?
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gonna move this guy to the Beginner's forum, since it isn't related to I/O or Streams, and would probably get answered quicker there.
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh yeah, and welcome to the Ranch Viral!
As for your question, are you trying to print the String and the token together, so something like "data;", or do you want to print "data" then ";"?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could we see the iteration code? (Be sure to use the UBB code tags).
bear
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Jason alluded to, and perhaps what viral is looking to discover is the StringTokenizer constructor that takes three arguments. Take a look at The StringTokenizer Class Documentation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic