Remove all special characters except space from a string using JavaScript -
i want remove special characters except space string using javascript.
for example, abc's test#s
should output abcs tests
.
you should use string replace function, single regex. assuming special characters, mean that's not letter, here solution:
var str = "abc's test#s"; alert(str.replace(/[^a-za-z ]/g, ""));
Comments
Post a Comment