SyntaxFix
Write A Post
Hire A Developer
Questions
You should use the string replace function, with a single regex. Assuming by special characters, you mean anything that's not letter, here is a solution:
const str = "abc's test#s";_x000D_ console.log(str.replace(/[^a-zA-Z ]/g, ""));