Does anyone now a simple and easy way to pad the end of a line with spaces (\s) so its a fixed size.
Example:
I have strings that look like this:
LR20SR37PD30LR23CR23BT01H
I need to have each string a fixed size of 40 chars
Example:
LR20SR37PD30LR23CR23BT01H\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s
Should I use sprintf, and a while loop, or is there an easier way??
Thanks!
In reply to Padding with \s by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |