Help for this page

Select Code to Download


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