removeNonAlphaNumeric method

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

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

When allowSpace is true, space characters are preserved.

Implementation

@useResult
String removeNonAlphaNumeric({bool allowSpace = false}) => replaceAll(
  allowSpace ? _alphaNumericOnlyWithSpaceRegex : _alphaNumericOnlyRegex,
  '',
);