Javascript String replaceAll(origin, replace)

Description

Javascript String replaceAll(origin, replace)


String.prototype.replaceAll = function(origin, replace){
  var regexp = new RegExp(origin,'g');
  return this.replace(regexp,replace);
};



PreviousNext

Related