This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv 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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "testing a delimeter" Watch "testing a delimeter" New topic

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.
"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?
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
I agree. Here's the link:
subject: testing a delimeter
It's not a secret anymore!