W3cubDocs

/Dart 2

rawIndex property

int rawIndex

Returns the starting position of the current rune in the string.

Returns null if the current rune is null.

Implementation

int get rawIndex => (_position != _nextPosition) ? _position : null;
void rawIndex= (int rawIndex)

Resets the iterator to the rune at the specified index of the string.

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

Setting the position to the end of then string will set current to null.

Implementation

void set rawIndex(int rawIndex) {
  RangeError.checkValidIndex(rawIndex, string, "rawIndex");
  reset(rawIndex);
  moveNext();
}

© 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/rawIndex.html