Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Pulling white space off before/after string?

by swampyankee (Parson)
on Apr 17, 2007 at 04:43 UTC ( [id://610456]=note: print w/replies, xml ) Need Help??


in reply to Pulling white space off before/after string?

With a regex, of course.

s/^\s+//; # removes leading white space s/\s+$//; # removes trailing white space

emc

Insisting on perfect safety is for people who don't have the balls to live in the real world.

—Mary Shafer, NASA Dryden Flight Research Center

Log In?
Username:
Password:

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

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

    No recent polls found