That's just how StringTokenizer works: by default, consecutive delimiters are collapsed into a single delimiter. You can change the behavior so that individual delimiter characters count as tokens; that lets you infer the presence of an empty token, anyway. This is well-documented on the API page for this class; you have read it, right?