replaceAll 全局替换

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

转自:https://www.jb51.net/article/40269.htm

猜你喜欢

转载自blog.csdn.net/qq_18676843/article/details/84984647
今日推荐