startsWith method
Does the input start with the given string, if we start from the current position.
Implementation
bool startsWith(String pattern) {
if (contents is String) return contents.startsWith(pattern, index);
return pattern == peek(pattern.length);
}