Answers for "replace all characters in js"

6

how to replace all characters in a string javascript

const string = "a, b, c, d, e, f";
string.replace(/,/g, '');
console.log(string) //a b c d e f
Posted by: Guest on March-24-2021
1

js replace all char in string

"x".replaceAll("x", "xyz");
// xyz

"x".replaceAll("", "xyz");
// xyzxxyz

"aA".replaceAll("a", "b", true);
// bb

"Hello???".replaceAll("?", "!");
// Hello!!!
Posted by: Guest on October-26-2021

Code answers related to "replace all characters in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language