JS中replaceAll方法的实现String.prototype.replaceAll function(s1,s2) {return this.replace(new RegE
JS中replaceAll方法的实现
String.prototype.replaceAll = function(s1,s2) {
return this.replace(new RegExp(s1,"gm"),s2);
};
JS中replaceAll方法的实现
String.prototype.replaceAll = function(s1,s2) {
return this.replace(new RegExp(s1,"gm"),s2);
};