dnamonk has asked for the wisdom of the Perl Monks concerning the following question:
I am wondering what is the easiest way to compare substrings to know how many mismatches are there. For example:
String1 String2 #Mismatches
ABCGE ABCGE 0
ABCGE FGCGB 3
ABCGE JHAGT 4
I was thinking to compare arrays. Or maybe create a hash array and then use index() ?
Thanks in advance :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Comparing string characters
by choroba (Cardinal) on Nov 22, 2021 at 16:42 UTC | |
by dnamonk (Acolyte) on Nov 22, 2021 at 18:19 UTC | |
by LanX (Saint) on Nov 22, 2021 at 17:42 UTC | |
|
Re: Comparing string characters
by kcott (Archbishop) on Nov 22, 2021 at 23:50 UTC | |
by Marshall (Canon) on Nov 23, 2021 at 18:56 UTC | |
|
Re: Comparing string characters
by LanX (Saint) on Nov 22, 2021 at 17:31 UTC | |
by dnamonk (Acolyte) on Nov 22, 2021 at 18:20 UTC |