Js 之封装replaceAll批量替换 一、代码 String.prototype.replaceAll = function (s1, s2) { return this.replace(new RegExp(s1, 'gm'), s2) };