startsWith method

bool startsWith(
  1. MutableStringSlice other
)

Implementation

bool startsWith(MutableStringSlice other) {
  if (other.length > this.length) {
    return false;
  }
  if (other == this) {
    return true;
  }

  for (int i = _startIndex, j = other._startIndex;
      j < other.length;
      i++, j++) {
    if (other._source.codeUnitAt(j) != _source.codeUnitAt(i)) {
      return false;
    }
  }
  return true;
}