Switch back from String#charAt(0)==x to startsWith(x): safer, not much slower.