📅  最后修改于: 2022-03-11 15:01:44.997000             🧑  作者: Mango
let str = 'JS will, JS will rock you!';
let newStr = str.replace(/JS/g,'JavaScript');
console.log(newStr);
Code language: JavaScript (javascript)
//output :JavaScript will, JavaScript will rock you!