Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

How do I quickly strip blank space from the beginning/end of a string?

by blahblahblah (Priest)
on Jul 21, 2009 at 20:47 UTC ( #782077=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
         How do I strip blank space from the beginning/end of a
         string?
    ...
    
                 s/^\s+//;
                 s/\s+$//;
    
  2. or download this
    use Benchmark 'cmpthese';
    
    ...
    [16:10] <Joe> capt_repl 271691/s        4%        --       -3%      -6
    +8%
    [16:10] <Joe> rx_rx     279271/s        7%        3%        --      -6
    +7%
    [16:10] <Joe> last      859023/s      228%      216%      208%        
    +--
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2019-06-26 18:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (111 votes). Check out past polls.

    Notices?