in reply to number of unique characters in a string
my $txt1 = "0101010101"; my $count; my %hashofuniq; my @txt1 = split ('',$txt1); @hashofuniq{@txt1} = 1; foreach (keys %hashofuniq){ $count++; } print "[$count]\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: number of unique characters in a string
by rob_au (Abbot) on Mar 01, 2003 at 04:08 UTC | |
by crenz (Priest) on Mar 01, 2003 at 17:54 UTC | |
by genecutl (Beadle) on Mar 03, 2003 at 23:41 UTC |