preserveOnlyChars function
Returns a String that is made of some required chars only. Optionally the removed characters can be substituted with a replacement char
Implementation
String preserveOnlyChars(String string, String validChars,
{String? replacementChar}) =>
string.preserveOnlyChars(validChars, replacementChar: replacementChar);