Hej all,
This should be simple but I can seem to find a way of doing it in from my Perl book.
I have a string of numbers e.g "123" but I want to pad it out to 5 by adding ones to the front hence making it "00123".
However the string can be variable length, so whats a good way of checking the size of the string, and adding the required number of zeros.
Its not just 5 characters long I need - other areas of my script need 2, 3 and 10. Something generic would be nice.
- Jed
In reply to Padding out strings. by Speedfreak
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |