Answers for "javascript string replace array of characters"

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
0

replace characters form array

let str = 'Twas the night before Xmas...';
let newstr = str.replace(/xmas/i, 'Christmas');
console.log(newstr);  // Twas the night before Christmas...
Posted by: Guest on November-25-2021

Code answers related to "javascript string replace array of characters"

Code answers related to "Javascript"

Browse Popular Code Answers by Language