1var str = "Hello^# World/";
2str.replace(/[^a-zA-Z ]/g, ""); // "Hello World"
1//You can do it specifying the characters you want to remove:
2string = string.replace(/[&\/\\#,+()$~%.'":*?<>{}]/g, '');
3//Alternatively, to change all characters except numbers and letters, try:
4string = string.replace(/[^a-zA-Z0-9]/g, '');