String truncate Start - Node.js String

Node.js examples for String:sub string

Description

String truncate Start

Demo Code

String.prototype.truncateStart = function k(p, o) {
    if (p >= this.length) {
        return this
    }/*from  w  ww .ja  v  a 2s.com*/
    if (o === undefined) {
        o = "..."
    }
    return this.substring(o + (p - o.length), p)
};

Related Tutorials