toLetter static method

String? toLetter(
  1. String? value
)

Converts a string to contain only letters.

Example: 'abc123' -> 'abc'

Implementation

static String? toLetter(String? value) {
  if (value == null || value.isEmpty) return null;
  String buffer = '';
  for (String character in value.characters) {
    if (Validator.isLetter(character)) buffer = '$buffer$character';
  }
  return buffer;
}