Javascript String allReplace(args)
String.prototype.allReplace = function(args) { var str = this; for (var x in args) { str = str.replace(new RegExp(x, 'g'), args[x]); }/* ww w . j a v a2 s. c o m*/ return str; };