I think has the same behaviour as the others. Not tested fully. Not that I think it's any faster than any substr method, but it's an alternative.sub trimTo { my ($line, $length) = @_; $line =~ s/^(.{0,$length}\s|.{$length}).*/$1.../; return $line; }
In reply to Re: In search of a better way to trim string
by Jasper
in thread In search of a better way to trim string
by kiat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |