Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

flutter remove character from string

The docs for the RegExp class state that you should use raw strings (a string literal prefixed with an r, like r"Hello world") if you're constructing a regular expression that way. This is particularly necessary where you're using escapes.

In addition, your regex is going to catch spaces as well, so you'll need to modify that. You can use RegExp(r"[^sw]") instead - that matches any character that's not whitespace or a word character
 
PREVIOUS NEXT
Tagged: #flutter #remove #character #string
ADD COMMENT
Topic
Name
9+3 =