Node.js examples for String:Padding
Pad string with given length
Utils.pad = function(str, len, pad) { var str = ""+str; if (len > str.length) { return Array(len + 1 - str.length).join(pad) + str; }/* w w w. j a v a2s .c o m*/ return str; }