- or download this
print mine ("Terence and Philip are sweet", 'c', 'Z', 3);
- or download this
sub crep {
my ($str, $chr, $rep, $nth) = @_;
...
substr ($str, $pos) =~ s/$chr/$rep/g if $pos >= 0;
return $str;
}
- or download this
sub crep {
my ($str, $chr, $rep, $num) = @_;
...
$str =~ s/$chr/$rep/g;
$tstr.$str;
}
- or download this
sub crep {
my ($str, $chr, $rep, $num) = @_;
...
substr ($str, -1 + pos $str) =~ s/$chr/$rep/g;
return $str;
}
- or download this
sub crep {
my ($str, $chr, $rep, $nth) = @_;
...
substr ($str, $pos) =~ s/$chr/$rep/g;
return $str;
}