If your strings are really quite long, and you want all characters in groups of 3, then using tr/// first is ~50 times quicker:
$x =~ tr[A-Za-z][]s; $x =~ s[(.)][$1 x 3]ge;
In reply to Re: More efficient way to truncate long strings of the same character
by BrowserUk
in thread More efficient way to truncate long strings of the same character
by kurtis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |