Posted By

psradich111 on 08/19/11


Tagged

javascript replace String all


Versions (?)

Javascript Replace All in string


 / Published in: JavaScript
 

Replaces all matches in a string used str.replaceAll(find,replace);

  1. //used str.replaceAll(find,replace);
  2. String.prototype.replaceAll = function(s1, s2) { return this.split(s1).join(s2)}

Report this snippet  

You need to login to post a comment.