Use startsWith instead of parsing with charAt