+ 7
How to remove symbols character from string in js?
Example : let text = "@#wz32r$r&(A)+(6&"
2 ответов
+ 4
const result = str.replace(/\W/g, ""))
\W matches any character that isn't included in a-z, A-Z, 0-9 and _, and we are replacing it with "". If you wanna filter out "_" as well, use this regex, /\W|_/g, which means \W or _, find any of these, replace it with "".
+ 3
maf
Good. thank you