Answers for "replace a all char in a string for other char js"

8

js replace characters in a string

var str = "Original string!";
var str = str.replace("Original", "New");
Posted by: Guest on September-29-2020
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 a all char in a string for other char js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language