Help for this page

Select Code to Download


  1. or download this
    # swap ($s, $p1, $p2, $n);
    # in $s swap the $n bits at bit $p1 and $p2
    ...
    print "$string\n";
    swap($string, 0,16,16);
    print "$string\n";
    
  2. or download this
    # swap first character with itself
    swap($string, 0, 0, 8);