Javascript String padLeft(padString,length)

Description

Javascript String padLeft(padString,length)


String.prototype.padLeft = function(padString,length){

    var str = this;
    while (str.length < length)
        str = padString + str;/*  w w w.j  av a2s. com*/
    return str;

};



PreviousNext

Related