Javascript String trimRight(charlist)

Description

Javascript String trimRight(charlist)


String.prototype.trimRight = function (charlist) {
    if (charlist === undefined)
        charlist = "\s";

    return this.replace(new RegExp("[" + charlist + "]+$"), "");
};



PreviousNext

Related