I have a string like this:
var str = \"I\'m a very^ we!rd* Str!ng.\";
What I would like to do is removing all special characters from the a
this will remove all the special character
str.replace(/[_\W]+/g, "");
this is really helpful and solve my issue. Please run the below code and ensure it works
var str="hello world !#to&you%*()"; console.log(str.replace(/[_\W]+/g, ""));