Hey Folks, I'm trying to find a way to easily pad numbers and strings with characters of your choice.
The method I'm using now is a simple sprintf command: sprintf("%03d", ++$i), which can for example be used in a loop.
Now, I stumbled upon this site where they say this can be easily done just by adding a few characters of code using the inventiveness of Perl.
I was wondering which that inventive method is. Any inputs on this?
Thanks, Iwein
In reply to Clever Padding by iweindesmedt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |