skipString method

bool skipString(
  1. String s
)

Skip over s and return true if s matches the text after the cursor, and return false otherwise.

You might also be interested in:

Implementation

bool skipString(String s) {
  if (index + s.length < end && buffer.substring(index, index + s.length) == s) {
    history.add(index);
    index += s.length;
    return true;
  }
  return false;
}