Javascript String shorten(max_length)

Description

Javascript String shorten(max_length)



String.prototype.shorten = function(max_length) {
    // TODO use max_length
    return this.replace(/^(.{15}[^\s]*).*/, "$1");
}



PreviousNext

Related