By default, StringTokenizer groups one or more consecutive delimiter characters together to separate tokens. However, it has an alternate method that will return both the tokens and each single delimeter character, also as a token.
If the returnDelims flag is true, then the delimiter characters are also returned as tokens. Each delimiter is returned as a string of length one. If the flag is false, the delimiter characters are skipped and only serve as separators between tokens.
While not as simple to use as String.split(","), it would allow you to determine when to create empty tokens. If you have to run in pre-1.4 JVMs, it's a reasonable route. Of course, if comma is your only delimiter character, you could write your own split method in a few lines of code.
[ April 30, 2005: Message edited by: David Harkness ]