var str = "Hello^# World/";
str.replace(/[^a-zA-Z ]/g, ""); // "Hello World"
var desired = stringToReplace.replace(/[^ws]/gi, '')
//if you are using non english like arabic and other language
var outString = sourceString.replace(/[`~!@#$%^&*()_|+-=?;:'",.<>{}[]/]/gi, '');
function myFunction(a, b) {
const str = a.concat(b.split("").reverse().join("")).replaceAll("%", "");
return str[0].toUpperCase() + str.slice(1);}