charAt function

String charAt(
  1. String subject,
  2. int position
)

Implementation

String charAt(String subject, int position) {
  if (subject is! String ||
      subject.length <= position ||
      subject.length + position < 0) {
    return '';
  }

  final _realPosition = position < 0 ? subject.length + position : position;
  return subject[_realPosition];
}