Javascript String slim()
slim()
String.prototype.slim = function () { var r = this.replace(/\n/g, " "); return r.replace(/\s{2,}/g, "").trim(); }