|
|
| Just another Perl shrine | |
| PerlMonks |
Re: Strip leading and trailing blanksby snax (Hermit) |
| on Jul 30, 2003 at 12:18 UTC ( [id://279237]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
TIMTOWTDI :)
I've always been fond of this, which also compresses "extra" spaces in the middle to a single space: It's not all that much slower than the others, and if you want to compress the internal whitespace it's hard to beat. Lots of my proggies have a little sub: which takes advantage (in terseness, not speed) of the magic of $_ and split's default behavior.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||