use strict; use warnings; my $str = q{"654321_1111"}; $str =~ s/^"|"$//g; print "'$str'\n";
Prints:
'654321_1111'
Note that the single quotes are added in the print to demonstrate that there are no "hidden" characters like spaces or line breaks included in the string.
Update: fix $str quoting issue pointed out by LanX.
In reply to Re: remove first and last character of string
by GrandFather
in thread remove first and last character of string
by flieckster
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |