handle space-only strings, not just zero-length