Answers for "find and replace regex javascript"

1

replace all js

let a = 'a a a a aaaa aa a a';
a.replace(/aa/g, 'bb');
// => "a a a a bbbb bb a a"
Posted by: Guest on August-27-2020
3

javascript regex replace

const search = 'duck'
const replaceWith = 'goose';

const result = 'duck duck go'.replaceAll(search, replaceWith);

result; // => 'goose goose go'
Posted by: Guest on June-23-2020
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."
Posted by: Guest on November-23-2020
6

str replace javascript all

str.replace(/abc/g, '');
Posted by: Guest on May-16-2020

Code answers related to "find and replace regex javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language