startsWith method
- String pattern
Checks whether the string view begins with the given pattern.
Implementation
bool startsWith(String pattern) {
if (pattern.length > length) return false;
for (int i = 0; i < pattern.length; i++) {
if (_string[_start + i] != pattern[i]) return false;
}
return true;
}