You could also do it with a greedy regex, as stated above:$txt = "This_is_a_song_.mp3"; substr($txt, rindex($txt, '_'), 1) = ''; print $txt;
$txt = "This_is_a_song_.mp3"; $txt =~ s/(.*)_/$1/; print $txt;
In reply to Re: Removing underscores.
by TedPride
in thread Removing underscores.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |