Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

String Tokenizing Question

807598Oct 11 2006 — edited Oct 11 2006
Hello -

I'm able to tokenize w/o any problems, save for when I run into consecutive instances of the character, a comma, that I am using for my delimiter. Here's a sample line:

The,lazy,fox,,jumped,,,over,the,,,moon,,,,,

So, if my string has values for each field that the tokenizer looks at, I have no problems, but if there are two or more commas (delimiters) in sequence, it breaks the tokenizer.

So what I'd like to do barring a better/simpler solution is to print "N/A" or something if there is no data in that token and then continue on to assign each (valid) token to a String variable.

Thanks...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 8 2006
Added on Oct 11 2006
16 comments
229 views