js replaceAll

Posted 璃天沫

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了js replaceAll相关的知识,希望对你有一定的参考价值。

var str = "dogdogdog";
var str2 = str.replace(/dog/g,"cat");
console.log(str2);

参考:https://blog.csdn.net/fukaiit/article/details/83245943

以上是关于js replaceAll的主要内容,如果未能解决你的问题,请参考以下文章