Replace all special characters with space

0
Hi All,   I have a string and I want to replace all special characters with space from that string using microflow. Anyone know how to do that?
asked
3 answers
0

Hi Madhura,
Use replaceAll(). The original string, with all occurrences of the regular expression replaced by the replacement string. 
If the regular expression does not occur in the string, the original is returned.
ex,
replaceAll('this @string ##', '^([0-9]+)$', ' ')  will return → ‘this  string  ‘

This may help you!

answered
2

Hi Madhura,

I would use a regex in a combination with toLowerCase for this

toLowerCase(replaceAll($Name,'\W++',''))

where $Name is the attribute that you want to sanitize and '\W++' matches one or more non-word characters. For more information see https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html

and  https://docs.mendix.com/refguide/string-function-calls/#13-replaceall and https://docs.mendix.com/refguide/string-function-calls/#11-trim 

 

Hope this helps,

answered
0

 

I am getting this two errors while using replaceAll function.

 

answered