Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Generating standard length strings

by RazorbladeBidet (Friar)
on Apr 14, 2005 at 19:00 UTC ( #447914=note: print w/replies, xml ) Need Help??


in reply to Generating standard length strings

You want string multiplication a la:
sub standard_fill { my $string = $_[0]; my $length = $_[1]; my $orig_string_length = length($string); $string .= " " x ($length - $orig_string_length); return $string }
(code untested)

I'll leave the golfing to the PGA tour ;)
--------------
"But what of all those sweet words you spoke in private?"
"Oh that's just what we call pillow talk, baby, that's all."

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2020-10-29 07:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (269 votes). Check out past polls.

    Notices?