Answers for "replace all special characters in javascript"

0

js remove special characters

var desired = stringToReplace.replace(/[^\w\s]/gi, '')
Posted by: Guest on September-23-2020
-2

javascript have special characters

var format = /[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/;
//            ^                                       ^   
document.write(format.test("My@string-with(some%text)") + "<br/>");
document.write(format.test("My string with spaces") + "<br/>");
document.write(format.test("MyStringContainingNoSpecialChars"));
Posted by: Guest on November-15-2020

Code answers related to "replace all special characters in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language