Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Generating standard length strings

by Fletch (Bishop)
on Apr 14, 2005 at 19:00 UTC ( [id://447915]=note: print w/replies, xml ) Need Help??


in reply to Generating standard length strings

my $str = sprintf( "%${len}s", $str );

perldoc -f sprintf if you need to do anything fancier like left justify.

Update: D'oh, the original question was about left justified. Not like there's not 15 bazillion other answers to pick from . . . :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-23 15:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found