Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: what is the function should I need to use for trim white spaces ?

by ikegami (Patriarch)
on Jan 11, 2006 at 19:22 UTC ( [id://522536]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    s/^\s+//g, s/\s+$//g for $value;
    
  2. or download this
    sub trim {
       local $_ = @_ ? $_[0] : $_;
    ...
    $trimmed = trim;                      # Trims $_ by default.
    @trimmed = map trim, @untrimmed;      # Trim a whole list. (readable)
    push(@trimmed, trim) for @untrimmed;  # Trim a whole list. (efficient)
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-25 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found