Javascript String replaceAll(needle, replace)

Description

Javascript String replaceAll(needle, replace)


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



PreviousNext

Related