12 lines
250 B
Text
12 lines
250 B
Text
sub LCS$(a$, b$)
|
|
if len(a$) = 0 or len(b$) = 0 return
|
|
while len(b$)
|
|
for j = len(b$) to 1 step -1
|
|
if instr(a$, left$(b$, j)) return left$(b$, j)
|
|
next j
|
|
b$ = mid$(b$, 2)
|
|
wend
|
|
end sub
|
|
|
|
print LCS$("thisisatest", "testing123testing")
|
|
end
|