sub rot { my $str = shift; my $rot = (shift) % length($str); # to rotate more than once $str =~ s/(.{$rot})(.*)/$2$1/; $str; }
?
In reply to Re: Rotating a string
by nashdj
in thread Rotating a string
by ariels
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |