matchingCharacterDescription property

String get matchingCharacterDescription

Returns a human-readable description of the matching character.

Implementation

String get matchingCharacterDescription {
  String description = '"$matchingCharacter"';

  if (isLetter(matchingCharacter)) {
    if (isUpperCase(matchingCharacter)) {
      description = CharacterLabels.upperCase;
    } else {
      description = CharacterLabels.lowerCase;
    }
    description += ' "${matchingCharacter.toUpperCase()}"';
  }

  if (isDigit(matchingCharacter)) {
    description =
        '${CharacterLabels.digit} "$matchingCharacter"${matchingCharacter == '0' ? ' Zero' : ''}';
  }
  return description;
}