Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Replace all ocourrences in JS

let str = 'hotdog dog'.replace(new RegExp('dog','g'), 'cat');
console.log(str) //output: hotcat cat
Source by www.syncfusion.com #
 
PREVIOUS NEXT
Tagged: #Replace #ocourrences #JS
ADD COMMENT
Topic
Name
4+2 =