Js 之封装replaceAll批量替换

一、代码

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

 

posted @ 2020-05-11 14:41  样子2018  阅读(440)  评论(0)    收藏  举报