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

Re: trimming space from both sides of a string

by JavaFan (Canon)
on Oct 14, 2010 at 15:35 UTC ( [id://865288]=note: print w/replies, xml ) Need Help??


in reply to trimming space from both sides of a string

I find trimming space quite boring. There's nothing interesting about it. What I do is:
$str =~ s/^\s+//; $str =~ s/\s+$//;
rtrim/ltrim following trivially from it.

Log In?
Username:
Password:

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

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

    No recent polls found