js replaceAll

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

 

posted @ 2019-02-15 10:29  蒲木杉  阅读(275)  评论(0)    收藏  举报