cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing many special characters using one function one time

KTsnap
New Contributor III

Hi All,
I want to replace the following special characters : > % ? \ with space .
I do not want to use multiple replace function. Is it possible to do with one replace function.
Thanks for your time.

1 REPLY 1

Aleksandar_A
Contributor III

Hi @KTsnap,

Yes, it is possible to use the .replace() function with a given pattern (regex).

In your case this should do the job:
$str.replace(/:|>|%|\?|\\/g,' ')

Also, if you need additional info please check the replace() function documentation.

Let me know if this helps you.

BR,
Aleksandar.