[I swear, Dirk's code sample wasn't there when I first wrote this...]
StringTokenizer is pretty inconvenient for this sort of thing. That boolean argument Dirk mentions modifies its behavior, but it's still not very easy to use. There are various workarounds, but probably the easiest is to use the String split() method in JDK 1.4:
This has two big advantages: (1) it handles multi-character tokens the way most people would expect, and (2) if two tokens are next to one another it returns a blank string for that field.
[ August 19, 2002: Message edited by: Jim Yingst ]