Help for this page

Select Code to Download


  1. or download this
    my @strings = qw( aaabbbb ab abb aabb aaabb aabbb );
    
    ...
        my $b_counter = $string =~ tr/b/b/;
        print "In $string there were $a_counter 'a's and $b_counter 'b's. 
    +\n";
    }