in reply to trim leading & trailing whitespace
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: trim leading & trailing whitespace
by ady (Deacon) on Mar 30, 2005 at 08:47 UTC |
In Section
Seekers of Perl Wisdom