replace £ in replace function js code example
Example 1: js replace characters in a string
var str = "Original string!";
var str = str.replace("Original", "New");
Example 2: string replace javascript
let re = /apples/gi;
let str = "Apples are round, and apples are juicy.";
let newstr = str.replace(re, "oranges");
console.log(newstr)
output:
"oranges are round, and oranges are juicy."