in reply to Conditional Bitwise XOR(^) Operator in Matching Chars Count of Two Strings?
Mutate the Ns first:
use strict; use warnings; use Data::Dumper; my $s1 = "STCATTNNNSATCGCT"; my $s2 = "ATCGTCGSNNNNATCG"; $s1 =~ tr/N/n/; my $merge = $s1 ^ $s2; my $count = $merge =~ tr/\0//; print $count;
Prints:
4
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Conditional Bitwise XOR(^) Operator in Matching Chars Count of Two Strings
by inman (Curate) on Nov 09, 2005 at 11:41 UTC |