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