toAlphaOnly method

  1. @useResult
String toAlphaOnly({
  1. bool allowSpace = false,
})

Returns a new string with all non-letter characters removed.

When allowSpace is true, space characters are preserved.

Implementation

@useResult
String toAlphaOnly({bool allowSpace = false}) =>
    replaceAll(allowSpace ? _alphaOnlyWithSpaceRegex : _alphaOnlyRegex, '');