File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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!