Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Padding with \s

by boo_radley (Parson)
on Sep 13, 2002 at 13:39 UTC ( [id://197576]=note: print w/replies, xml ) Need Help??


in reply to Padding with \s

you could use concatenation ("the dot operator") :
my $crypticString="LR20SR37PD30LR23CR23BT01H"; my $acceptableLength=40; my $paddedString =$crypticString . " " x ($acceptableLength - length ($crypticString)); print "'$paddedString'";
Also, using \s to indicate " " might be confused with the character class \s (which also includes newlines and tabs).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://197576]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-04-23 21:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found