It might be safer to use some kind of `isSpace()`-esque method.  Vertical tabs and other whitespace oddities need to be removed as well.