charAt method

String? charAt(
  1. int index
)

Safely accesses a character by index, returns null if index is out of bounds

Example:

"hello".charAt(1); // Returns "e"
"hello".charAt(10); // Returns null

Implementation

String? charAt(int index) =>
    (index >= 0 && index < length) ? this[index] : null;