in reply to Re: Fastest (Golfish) way to strip whitspace off ends.
in thread Fastest (Golfish) way to strip whitspace off ends.
sub trim { @_ = ($_) if not @_; # doesn't work foreach (@_) { s/^\s*//; s/\s*$//; s/\n\z//s; } return wantarray? @_ : $_[0]; }
--
[ e d @ h a l l e y . c c ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Fastest (Golfish) way to strip whitspace off ends.
by BrowserUk (Patriarch) on Jul 02, 2003 at 17:21 UTC | |
|
Re: Re: Re: Fastest (Golfish) way to strip whitspace off ends.
by Enlil (Parson) on Jul 02, 2003 at 22:32 UTC |