aspose file tools*
The moose likes Beginning Java and the fly likes StringTokenizer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "StringTokenizer" Watch "StringTokenizer" New topic
Author

StringTokenizer

viral trivedi
Greenhorn

Joined: Apr 24, 2003
Posts: 3
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

Joined: May 08, 2001
Posts: 1932
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

Joined: May 08, 2001
Posts: 1932
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

Joined: Jan 10, 2002
Posts: 61241
    
  66

Could we see the iteration code? (Be sure to use the UBB code tags).
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
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.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
Consider Paul's rocket mass heater.
 
subject: StringTokenizer