How to remove all special characters using JavaScript in Lightning in Salesforce?

How to remove all special characters using JavaScript in Lightning in Salesforce?

Sample Code:

var abc = "Infallible's Techie's & devel#opment %Inc. ";
var s = abc.replace(/[^a-zA-Z0-9s]/g, "").replace(/ss/g, " ");
alert(s);

Output:

Leave a Reply