Answers for "loop through text and replace js"

10

how to use the replace method in javascript

let string = 'soandso, my name is soandso';

let replaced = string.replace(/soandso/gi, 'Dylan');

console.log(replaced); //Dylan, my name is Dylan
Posted by: Guest on April-15-2020
0

replace each string by another string javascript

str.split(search).join(replacement)
Posted by: Guest on February-05-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language