RuneIterator.at constructor

RuneIterator.at(
  1. String string,
  2. int index
)

Create an iterator positioned before the indexth code unit of the string.

When created, there is no current value. A moveNext will use the rune starting at index the current value, and a movePrevious will use the rune ending just before index as the the current value.

The index position must not be in the middle of a surrogate pair.

Implementation

RuneIterator.at(String string, int index)
    : string = string,
      _position = index,
      _nextPosition = index {
  RangeError.checkValueInInterval(index, 0, string.length);
  _checkSplitSurrogate(index);
}