in reply to reversing substr
If you want the first two characters of the string, try this:
Or, if you want all but the last two characters, try this:my $str = "12345"; my $ss = substr($str, 0, 2); print $ss;
my $str = "12345"; my $ss = substr($str, 0, -2); print $ss;
|
---|