Longest common substring: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: undid a "bug-fix" as it broke the program and produced an incorrect result ("TES" instead of "TEXT").) |
(→Searching for smaller substrings of a in b: Trimming is not necessary in the C# implementation of the algorithm.) |
||
Line 80:
for (int k = lenx - j; k > -1; k--) /*step through string lengths. */
{
string common = x.Substring(j, k
if (y.IndexOf(common) > -1 && common.Length > output.Length) output = common; /*longest?*/
} /*k*/
|