Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Generating standard length strings

by RazorbladeBidet (Friar)
on Apr 14, 2005 at 19:00 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://447914]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-03-29 00:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found