Javascript String lpad(length, padString)

Description

Javascript String lpad(length, padString)


String.prototype.lpad = function(length, padString){
    var str = this;
    while (str.length < length)
        str = padString + str;/* w  w w. j a  v  a2 s.c o  m*/
    return str;
};



PreviousNext

Related