模拟JAVA replaceAll

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

你可能感兴趣的:(java,function)