jQuery in Action, 2nd edition*
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 Java 8 in Action this week in the Java 8 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: http://aspose.com/file-tools
subject: testing a delimeter
Similar Threads
testing a strinktokenizer
testing a stringtokenizer
Help with setting the JTable rows to resize to the size of the file
help with testing the last token