I can't vouch for best speed in benchmarks, but works in any case I've needed such a construct for.$string =~ s/^\s*(.*?)\s*$/$1/;
In reply to Re^2: trimming space from both sides of a string
by perl-diddler
in thread trimming space from both sides of a string
by szabgab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |