When comparing many strings against many strings (not just two), performance actually might matter.
On my machine, your substr method takes 2.65 secs, while the XOR method I suggested above takes only 0.12 secs (for the same data), i.e. it's roughly 20 times as fast.
In reply to Re^2: mismatching characters in dna sequence
by Eliya
in thread mismatching characters in dna sequence
by prbndr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |