Padding methods used in creation of DBF files as fields must be written to the specified length - Node.js String

Node.js examples for String:Padding

Description

Padding methods used in creation of DBF files as fields must be written to the specified length

Demo Code


//pad strings on the left 
String.prototype.lpad = function(padString, length) {
  var str = this;
    while (str.length < length)
        str = padString + str;/*from   w w w .  j  a  v a2  s .com*/
    return str;
}

Related Tutorials