Node.js examples for String:Replace
Replace all substring in a String
String.prototype.replaceAll = function(reallyDo, replaceWith, ignoreCase) { if (!RegExp.prototype.isPrototypeOf(reallyDo)) return this.replace(new RegExp(reallyDo, (ignoreCase ? "gi" : "g")), replaceWith);//from ww w.j av a 2 s . c o m else return this.replace(reallyDo, replaceWith); };