StringView.substring constructor

StringView.substring(
  1. String _string,
  2. int _start,
  3. int _end
)

Creates a StringView from a specific segment of a String.

The substring spans from start (inclusive) to end (exclusive).

Implementation

StringView.substring(this._string, this._start, this._end) {
  if (_start < 0 || _end > _string.length || _start > _end) {
    throw RangeError('Invalid substring bounds for StringView');
  }
}