$ perl -wE '$_ = " - - "; s/^\s*\b(.*)\b\s*$/$1/g; say qq["$_"]' " - - "
In general I prefer working over interesting solutions :-). Mine:
use v6; say ' - - '.trim.perl;
In reply to Re: trimming space from both sides of a string
by moritz
in thread trimming space from both sides of a string
by szabgab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |