Anonymous user
Longest common substring: Difference between revisions
m
→{{header|REXX}}: undid a "bug-fix" as it broke the program and produced an incorrect result ("TES" instead of "TEXT").
(→{{header|REXX}}: Bug fix.) |
m (→{{header|REXX}}: undid a "bug-fix" as it broke the program and produced an incorrect result ("TES" instead of "TEXT").) |
||
Line 167:
#=length(x) /*shortcut for using the X length*/
do j=1 for # /*step through start points in X.*/
do k=#
_=strip(substr(x,j,k)) /*extract a common substring. */
if pos(_,y)\==0 & length(_)>length($) then $=_ /*longest?*/
|