Here you can find the source of replaceAll(reallyDo, replaceWith, ignoreCase)
String.prototype.replaceAll = function(reallyDo, replaceWith, ignoreCase) { if (!RegExp.prototype.isPrototypeOf(reallyDo)) return this.replace(new RegExp(reallyDo, (ignoreCase ? "gi" : "g")), replaceWith);/* w w w .j ava 2 s .co m*/ else return this.replace(reallyDo, replaceWith); }; String.prototype.charLength = function() { var len = 0; for (var i = 0; i < this.length; i++) { var c = this.charCodeAt(i); if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) len += 1; else len += 2; } return len; }; Array.prototype.exist = function(el) { for (var i = 0; i < this.length; i++) if (this[i] == el) return i; return -1; }; Array.prototype.remove = function(el) { var temp = new Array(); for (var i = 0; i < this.length; i++) if (this[i] != el) temp.push(this[i]); return temp; };
String.prototype.replaceAll = function(org, dest) { return this.split(org).join(dest);
String.prototype.replaceAll = function(org, tag){ return this.replace(new RegExp(org, 'g'), tag); };
String.prototype.replaceAll = function(origin, replace){ var regexp = new RegExp(origin,'g'); return this.replace(regexp,replace); };
String.prototype.replaceAll = function(reallyDo, replaceWith, ignoreCase) { if (!RegExp.prototype.isPrototypeOf(reallyDo)) { return this.replace(new RegExp(reallyDo, (ignoreCase ? "gi": "g")), replaceWith); } else { return this.replace(reallyDo, replaceWith); };
String.prototype.replaceAll = function(reallyDo, replaceWith, ignoreCase) { if (!RegExp.prototype.isPrototypeOf(reallyDo)) return this.replace(new RegExp(reallyDo, (ignoreCase ? "gi" : "g")), replaceWith); else return this.replace(reallyDo, replaceWith); };
String.prototype.replaceAll = function (replace, value) { return this.replace(new RegExp(replace, 'g'), value); };
String.prototype.replaceAll = function(replacedText, replaceText){ return this.replace(new RegExp(replacedText, 'gm'), replaceText)
String.prototype.replaceAll = function(s1, s2) { return this.replace(new RegExp(s1, "gm"), s2)
String.prototype.replaceAll = function(s1, s2) { return this.replace(new RegExp(s1, "gm"), s2); }; String.prototype.replaceAll2Excep = function(s1, s2) { var temp = this; while (temp.indexOf(s1) != -1) { temp = temp.replace(s1, s2); return temp; ...