Posted By

mattlowden on 11/21/12


Tagged

javascript replace String replaceall


Versions (?)

replaceAll


 / Published in: JavaScript
 

Replace all instances of a string without using Regex.

  1. String.prototype.replaceAll = function(target, replacement) {
  2. return this.split(target).join(replacement);
  3. };

Report this snippet  

You need to login to post a comment.