This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes testing a delimeter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "testing a delimeter" Watch "testing a delimeter" New topic
Author

testing a delimeter

ben riches
Ranch Hand

Joined: Nov 08, 2002
Posts: 126
could someone please help me?
how can i test to see if the last token is a delimeter or not,
and if it is a delimeter (comma) i want to read it in as a blank string.
for example: ben,riches,
now i want three tokens.
ben
riches
"empty string"
also if the line starts with a comma i want it to print out a empty string.
could someone please give me some ideas?
thanks
ben
Shane Roylance
Ranch Hand

Joined: Aug 29, 2001
Posts: 72
If you are using 1.4, I think this will do it:
ben riches
Ranch Hand

Joined: Nov 08, 2002
Posts: 126
no i am not using 1.4.
i am using 1.3
any suggestions
Neil Laurance
Ranch Hand

Joined: Jul 18, 2002
Posts: 183
One way to do this:

Cheers Neil
 
Don't get me started about those stupid light bulbs.
 
subject: testing a delimeter
 
Similar Threads
testing a strinktokenizer
help with testing the last token
testing a stringtokenizer
stingTokenizer
Help with setting the JTable rows to resize to the size of the file