$str =~ s/\.\d+$//;
See perlretut for a gentle introduction to regexes.
That removes the last period followed by a number, at the end of the string. If you only want to remove .25, use s/\.25// instead.
In reply to Re: Truncate string without substr or length
by moritz
in thread Truncate string without substr or length
by spivey49
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |