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-9\s]/g, "").replace(/\s\s/g, " ");
        alert(s);

Output:


No comments:

Post a Comment