W3cubDocs

/Dart 2

reset method

void reset ([int rawIndex = 0 ])

Resets the iterator to the given index into the string.

After this the current value is unset. You must call moveNext make the rune at the position current, or movePrevious for the last rune before the position.

Setting a negative rawIndex, or one greater than string.length, is an error. So is setting it in the middle of a surrogate pair.

Implementation

void reset([int rawIndex = 0]) {
  RangeError.checkValueInInterval(rawIndex, 0, string.length, "rawIndex");
  _checkSplitSurrogate(rawIndex);
  _position = _nextPosition = rawIndex;
  _currentCodePoint = null;
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/2.0.0/dart-core/RuneIterator/reset.html