operator [] method

String operator [](
  1. int index
)

Returns the character at the given index.

Implementation

String operator [](int index) {
  if (index < 0 || index >= length) {
    throw RangeError.index(index, this);
  }
  return _string[_start + index];
}