Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by Your Mother (Archbishop)
on Jul 19, 2004 at 19:06 UTC ( [id://375652]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $mouse = 'This is a story about mice, "I dint know mice were so sma
    +rt."';
    print trimTo($mouse,30), "\n";
    
  2. or download this
    sub chop_to_size {
        my ($text, $length) = @_;
        return $text if length $text < $length;
    ...
        $text .= "...";
        $text;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-29 15:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found