Node.js examples for String:Replace
String.prototype.replaceAll = function replaceAll(a, b){
var s = this;/*from w w w. jav a2 s . c om*/ while(s.indexOf(a) > -1){ s = s.replace(a, b); } return s; };