removeExtraCharactersExcept method

String removeExtraCharactersExcept(
  1. String allowedCharacters
)

removeExtraCharactersExcept: removes extra characters from a string except the ones specified

Implementation

String removeExtraCharactersExcept(String allowedCharacters) => this?.replaceAll(RegExp('[^$allowedCharacters]'), '') ?? "";