js 扩展replaceAll

//扩展replaceAll;
String.prototype.replaceAll = function(s1,s2) {
return this.replace(new RegExp(s1,"gm"),s2);
}

原文地址:https://www.cnblogs.com/yanjunwu/p/4015113.html