in reply to Quick way to find the letter with the most occurences in a string
#!/usr/bin/perl -w use strict; my $string="CCCAAAAACCCAAAAAAACCCCBBBCCAAACCBBACBBAAAAAAAAAAACAAAAAAAA +AA"; my $nA = $string =~ tr/A//; my $nB = $string =~ tr/B//; my $nC = $string =~ tr/C//; print "A=$nA B=$nB C=$nC"; #A=37 B=7 C=16 #compare these 3 as you will to handle cases like #all are the same, etc
|
|---|