charAt static method

String? charAt(
  1. String subject,
  2. int index
)

Returns the character at index (negative indexes count from the end).

Implementation

static String? charAt(String subject, int index) {
  final i = index < 0 ? subject.length + index : index;
  if (i < 0 || i >= subject.length) return null;
  return subject[i];
}