Q:

javascript remove specific character from string

//replaces the first occurence only.
string.replace('characterToReplace', '');
or 
// first parameter is regular expression and g is global prop, replaces all occurences.
string.replace('/regex/g','');
7

var str = "Visit Microsoft!";

var res = str.replace("Microsoft", "W3Schools");
 
8
var newString = oldString.replaceAll("character/string goes here", "");

// Example
var oldString = "Hello World!";
var newString = oldString.replaceAll("o", "");
console.log(newString);
// Prints 'Hell Wrld!' to console.
0

New to Communities?

Join the community