Use this to remove special characters from a string, in other words, find a special character pattern and replace it with empty character,
str = str.replace(/[^a-zA-Z 0-9]+/g,”);
Advertisements
Use this to remove special characters from a string, in other words, find a special character pattern and replace it with empty character,
str = str.replace(/[^a-zA-Z 0-9]+/g,”);