Here you can find the source of replaceAll(find, replace)
// This function is used to create return id's that do not contains // characters that conflict with event handlers String.prototype.replaceAll = function (find, replace) { return this.replace(new RegExp(find, 'g'), replace); }; String.prototype.sanitize = function () { /*var s = this.replaceAll(" ", "_"); s = s.replaceAll(",", "");//from w w w.j av a2 s . c o m s = s.replace("&", ""); s = s.replace(":", ""); s = s.replace(".", ""); s = s.replace(/\(|\)/g,''); console.log(s);*/ var s = this.replace(/\W+/g, ""); return s; };
String.prototype.replaceAll = function(find, replace) { return this.replace(new RegExp(find, 'g'), replace); };
String.prototype.replaceAll = function (find, replace) { var str = this; return str.replace(new RegExp(find.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'g'), replace); };
function escapeRegExp(string) { return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); String.prototype.replaceAll = function (find, replace) { return this.replace(new RegExp(escapeRegExp(find), 'g'), replace);
String.prototype.replaceAll = function (find, replace) { return this.replace(new RegExp(find, 'g'), replace); };
String.prototype.replaceAll = function(find, replace){ find = find.escapeRegExp(); return this.replaceAllRegExp(find, replace); };
String.prototype.replaceAll = function(find, replace) { var str = this; return str.replace(new RegExp(find, 'g'), replace); };
String.prototype.replaceAll = function (find, replace) { var str = this; return str.replace(new RegExp(find.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'g'), replace); };
String.prototype.replaceAll = function (from, to) { if (from == ".") return this.replace(/\./g, to); var rgx = new RegExp(from, 'g'); return this.replace(rgx, to); };
String.prototype.replaceAll = function(from, to) { var str = this; while(str.indexOf(from)>=0) { str = str.replace(from, to); return str;