Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: How do I remove whitespace at the beginning or end of my string?

by trizen (Hermit)
on Nov 26, 2011 at 19:11 UTC ( [id://940206]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $l = length($string);
    $string = reverse unpack("A$l",reverse unpack("A$l",$string));
    
  2. or download this
                  Rate  two-s///     split m-capture    unpack s-with-\G
    two-s///  239349/s        --       -6%      -38%      -40%      -41%
    split     255782/s        7%        --      -33%      -36%      -37%
    m-capture 384362/s       61%       50%        --       -4%       -5%
    unpack    399865/s       67%       56%        4%        --       -1%
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-19 23:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found