替换全部

5年以前  |  阅读数:366 次  |  编程语言:JavaScript 
String.prototype.replaceAll = function(s1, s2) {
  return this.replace(new RegExp(s1, "gm"), s2);
};

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8