Help for this page

Select Code to Download


  1. or download this
    $str1='abcde';
    $str2='eda';
    ...
    $diff1=$str1=~tr/$str2//c;
    $diff2=$str1=~tr/eda//c;
    print "   diff1=$diff1, diff2=$diff2\n";
    
  2. or download this
    Test 1: strait set
       diff1=0, diff2=3
    Test 2: complement set
       diff1=5, diff2=2