Dart/Flutter – How to get the character at an index in a String

This is a quick note for me. It took me about 5 minutes to find a way to get the character at an index in a String. I didn’t know that String has [ ] operator. So I decided to write it here.

void main() {
  final String coflutter = 'Coflutter';
  print(coflutter[0]);
  print(coflutter[coflutter.length - 1]);
} 

// Output
C
r
Tagged : / / / / /