my $tofind="s"; my $replacement="X"; my $variable="snaskes"; my $tmp = chop $variable; $variable .= $tmp eq $tofind ? $replacement : $tmp; print $variable;
In reply to Re: Replace the last letter
by Golo
in thread Replace the last letter
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |