Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: trimming space from both sides of a string

by mr_mischief (Monsignor)
on Oct 16, 2010 at 16:04 UTC ( [id://865682]=note: print w/replies, xml ) Need Help??


in reply to Re^2: trimming space from both sides of a string
in thread trimming space from both sides of a string

oh! Right! No dot in there. s/^\s*//; s/\s*$//; instead of course. s/^\s+//; s/\s+$//; should work as well.

Replies are listed 'Best First'.
Re^4: trimming space from both sides of a string
by jwkrahn (Abbot) on Oct 16, 2010 at 19:31 UTC

    s/^\s+//; s/\s+$//; works better than s/^\s*//; s/\s*$//;.

Log In?
Username:
Password:

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

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

    No recent polls found