Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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

by JavaFan (Canon)
on Oct 09, 2008 at 22:15 UTC ( #716327=note: print w/replies, xml ) Need Help??


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

Assuming the first word doesn't consist of more than 50 characters (in which case, no solution is possible), a simple
s/\s/\n/;
will do. The first line will not be more than 50 characters, and the remainder will be in te second line.

It's not the solution that makes the longest first string possible with the given constraints, but then, you weren't asking for it.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://716327]
help
Chatterbox?
[LanX]: consideration is a democratic process
[Discipulus]: i'm sure germans has humor: i see them laughing
[Discipulus]: or it was beer?
Discipulus grin

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2017-04-27 20:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (513 votes). Check out past polls.