Also, using \s to indicate " " might be confused with the character class \s (which also includes newlines and tabs).my $crypticString="LR20SR37PD30LR23CR23BT01H"; my $acceptableLength=40; my $paddedString =$crypticString . " " x ($acceptableLength - length ($crypticString)); print "'$paddedString'";
In reply to Re: Padding with \s
by boo_radley
in thread Padding with \s
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |