Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How can I split a line close to a certain length, but on a word boundary?

by poznick (Initiate)
on Apr 25, 2000 at 02:07 UTC ( [id://8822]=note: print w/replies, xml ) Need Help??


in reply to How can I split a line on word boundaries closest to a certain length?

and true to the perl motto, here's yet another (much simpler) way to do it:
@text = $messagebody =~ /(.{1,140}\W)/gms;
  • Comment on Re: How can I split a line close to a certain length, but on a word boundary?

Log In?
Username:
Password:

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

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

    No recent polls found