javascript 的replaceAll实现

    技术2022-05-11  100

     

    String.prototype.replaceString  =  stringReplaceAll; function  stringReplaceAll(AFindText,ARepText) {  var raRegExp = new RegExp(AFindText.replace(/([()[]{}^$+-*?."'|//])/g,"/$1"),"g");  return this.replace(raRegExp,ARepText);}

    最新回复(0)