16 lines
300 B
Text
16 lines
300 B
Text
Procedure.s lcs(a$,b$)
|
|
If Len(a$)>Len(b$) : Swap a$,b$ : EndIf
|
|
l=Len(a$)
|
|
For c=1 To l
|
|
For i=1 To 1+l-c
|
|
If FindString(b$,Mid(a$,i,c))
|
|
res$=Mid(a$,i,c)
|
|
EndIf
|
|
Next
|
|
Next
|
|
ProcedureReturn res$
|
|
EndProcedure
|
|
|
|
t1$="testing123testing"
|
|
t2$="thisisatest"
|
|
Debug lcs(t1$,t2$)
|