Solution #7 - rindex
sub rindex { my $s = shift; substr($s, 0, rindex($s, ".")) =~ tr/.//d; return $s; }
TATMWTDI | There are too many ways to do it | #12 |
sub rindex { my $s = shift; substr($s, 0, rindex($s, ".")) =~ tr/.//d; return $s; }
Copyright © 2005 Shlomi Fish |