onlyLetters property

String get onlyLetters

Returns only the Latin OR Greek characters from the String.

Example

String foo = '4*%^55/σοφ4e5523ια';
String onlyL1 = foo.onlyLetters; // returns 'σοφια'
String foo2 = '4*%^55/es4e5523nt1is';
String onlyL2 = foo2.onlyLetters; // returns 'esentis'

Implementation

String get onlyLetters {
  if (isBlank) {
    return blankIfNull;
  }
  return only(alphaChars);
}