|
|
| Perl Monk, Perl Meditation | |
| PerlMonks |
Re: trim leading & trailing whitespaceby thinker (Parson) |
| on Mar 30, 2005 at 08:22 UTC ( #443370=note: print w/ replies, xml ) | Need Help?? |
|
If you want to trim the leading and trailing whitespace from every line in a multiline string, you can use s/^\s*(.*?)\s*$/$1/gm cheers thinker
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||