in reply to Finding Overlapping between 2 strings
Well, to show you a better way, we need to see the code you've written so far. You could also tell us why you think your code isn't ideal.
If your strings are of equal length and the overlappings start at the same position, finding them is easy:
my $str1 = 'a11211b123'; my $str2 = 'a11222b123'; my $overlapped = $str1 ^ $str2; $overlapped =~ s/\0/X/g; print $overlapped;
If your strings are of differing lengths, you will have to look at something like Algorithm::Diff.
|
|---|