removeExtraCharactersExcept method
removeExtraCharactersExcept: removes extra characters from a string except the ones specified
Implementation
String removeExtraCharactersExcept(String allowedCharacters) => this?.replaceAll(RegExp('[^$allowedCharacters]'), '') ?? "";