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").
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=#-j by -1 for #-j /*step through string lengths. */
_=strip(substr(x,j,k)) /*extract a common substring. */
if pos(_,y)\==0 & length(_)>length($) then $=_ /*longest?*/