Javascript String slim()

Description

Javascript String slim()

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



PreviousNext

Related