Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How to split a string into two lines, intelligently

by Andrew Coolman (Hermit)
on Oct 09, 2008 at 22:41 UTC ( [id://716331]=note: print w/replies, xml ) Need Help??


in reply to How to split a string into two lines, intelligently

This one might work if the characters are separated by spaces:
@arr = split (/\s/,$string); $part1 = (); $part2 = (); $len = 0; while (($len += 1 + length($part = shift @arr)) < 50) { $part1 .= "$part "; } $part2 = join(' ', @arr);

Regards,
s++ą  ł˝ ął. Ş ş şą Żľ ľą˛ş ą ŻĽąş.}++y~-~?-{~/s**$_*ee

Log In?
Username:
Password:

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

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

    No recent polls found