js replaceAll

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

 

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