There's more than one way to do things | |
PerlMonks |
Re: Re: regex verses join/splitby bwana147 (Pilgrim) |
on Jul 27, 2001 at 13:04 UTC ( [id://100252]=note: print w/replies, xml ) | Need Help?? |
Interesting, but the OP wanted to remove leading/trailing spaces, and collapse any sequence of whitespaces into one single space. You propose to remove any whitespace anywhere, which is not what was asked for. Still, it's true that tr/\n\r\f\t / /s would be more efficient than s/\s+/ /g. So, taking your remarks into account, I would say:
--bwana147
In Section
Seekers of Perl Wisdom
|
|