firstIndexIn method

int firstIndexIn(
  1. String sequence, [
  2. int start = 0
])

Returns the first matching index in sequence starting at start (inclusive). Returns -1 if it could not be found.

Implementation

int firstIndexIn(String sequence, [int start = 0]) {
  final iterator = _runeIteratorAt(sequence, start);
  while (iterator.moveNext()) {
    if (match(iterator.current)) {
      return iterator.rawIndex;
    }
  }
  return -1;
}