SyntaxFix
Write A Post
Hire A Developer
Questions
try doing str.replace(/[^\w]/); It will replace all the non-alphabets and numbers from your string!
Edit 1: str.replace(/[^\w]/g, ' ')
str.replace(/[^\w]/g, ' ')