getChar method

String getChar(
  1. int index
)

Returns the character at index as a single-character string.

Implementation

String getChar(int index) {
  if (index < 0 || index >= length) {
    throw RangeError.index(index, this, 'index');
  }
  return String.fromCharCode(chars[index]);
}