m2 has asked for the wisdom of the Perl Monks concerning the following question:
I want:$string1 = "the date is today"; $string2 = "the date is tomorrow";
It isn't hard to iterate over the first string letter by letter and do comparison to the second, but it really seems like there should be a more... elegant solution. Any ideas?$matchingpart = "the date is to" $diff1 = "day" $diff2 = "morrow"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Matching bits of 2 strings
by japhy (Canon) on Jan 22, 2002 at 04:50 UTC | |
Re: Matching bits of 2 strings
by Fletch (Bishop) on Jan 22, 2002 at 07:31 UTC | |
by japhy (Canon) on Jan 22, 2002 at 22:34 UTC | |
Re: Matching bits of 2 strings
by Zaxo (Archbishop) on Jan 22, 2002 at 07:04 UTC | |
Re: Matching bits of 2 strings
by Anonymous Monk on Jan 22, 2002 at 13:49 UTC |