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

Re: In search of a better way to trim string

by rrwo (Friar)
on Jul 20, 2004 at 04:12 UTC ( #375792=note: print w/replies, xml ) Need Help??


in reply to In search of a better way to trim string

Hm, there's Text::Truncate:

use Text::Truncate; my $short = truncstr($long, $len);

It may not be the most efficient way to do it, but you don't have to think about how to do it.

Disclaimer: I wrote that module a while ago because I was sick of rewriting a routine to do that all the time. Any ideas for improvements would be appreciated.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://375792]
help
Chatterbox?
Discipulus when in motorbike it is impossible to fall asleep.. another advantage
marioroy I once fell asleep while drive and had no collection on how I exited the ramp. Then called my wife not knowing where I was totally lost.
marioroy At a large firm, had to awaken a security guy a few times so that nobody would catch him sleeping.

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2017-05-29 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?