当前位置: 代码迷 >> JavaScript >> 兑现js的replaceAll方法
  详细解决方案

兑现js的replaceAll方法

热度:248   发布时间:2012-11-01 11:11:33.0
实现js的replaceAll方法
转载http://www.iteye.com/topic/67544


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


挺好用滴