Is there a javascript function that can pad a string to get to a determined length?

Posted by Anthony Potts on Stack Overflow See other posts from Stack Overflow or by Anthony Potts
Published on 2010-04-21T21:59:57Z Indexed on 2010/04/21 22:03 UTC
Read the original article Hit count: 283

Filed under:

I am in need of a javascript function which can take a value and pad it to a given length (I need spaces, but anything would do). I found this:

http://jsfromhell.com/string/pad

But I have no idea what the heck it is doing and it doesn't seem to work for me.

© Stack Overflow or respective owner

Related posts about JavaScript