Home > Uncategorized > A better StringTokenizer

A better StringTokenizer

by paul on December 22, 2008

I’ve just been reminded how painful it can be splitting a string based on a token with StringTokenizer. The problem is that it gets messy when you have two tokens consecutively. Luckily commons-lang comes to the rescue with StrTokenizer – where empty tokens may be removed or returned as null.

Leave a Comment

Previous post:

Next post: