Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: In search of a better way to trim string length

by BrowserUk (Pope)
on Jul 19, 2004 at 09:49 UTC ( #375505=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub trimTo {
        my( $str, $n ) = @_;    
    ...
    
        ## Tack on the '...'
    }
    
  2. or download this
    sub trimTo {
        my( $str, $n ) = @_;    
    ...
    
        return substr( $str, 0, $truncLen ) . ' ...';
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2015-07-28 06:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls