Javascript String trimBoth(s)

Description

Javascript String trimBoth(s)


String.prototype.trimBoth = function(s) {
    return this.replace(new RegExp("^" + s + "+|" + s + "+$", "gm"), "");
}



PreviousNext

Related