重复字符查找
表如下:m1 m2
acba
ab dackh
问题:
1、如何查找‘acba'有重复字符‘a’?
2、如何查找'ab'在‘dackh’中有重复字符?
谢谢!
[此贴子已经被作者于2020-2-6 10:11编辑过]
CLOSE DATABASES USE szpt BLANK FIELDS _12重复, _13重复, _23重复, 说明 ALL SCAN c1 = ALLTRIM(M1w) c2 = ALLTRIM(M2w) c3 = ALLTRIM(M3w) LOCAL b[3] b = "" csm = "重复" b[1] = CHRTRAN(c2,CHRTRAN(c2, c1, ""), "") IF NOT EMPTY(b[1]) REPLACE _12重复 WITH "_12重复" ENDIF b[2] = CHRTRAN(c3,CHRTRAN(c3, c1, ""), "") IF NOT EMPTY(b[2]) REPLACE _13重复 WITH "_13重复" ENDIF b[3] = CHRTRAN(c3,CHRTRAN(c3, c2, ""), "") IF NOT EMPTY(b[3]) REPLACE _23重复 WITH "_23重复" ENDIF FOR i = 1 TO 3 IF NOT b[i] $ csm csm = csm + b[i] ENDIF ENDFOR IF LEN(csm) > 4 REPLACE 说明 WITH csm ENDIF ENDSCAN GO TOP BROWSE
[此贴子已经被作者于2020-2-6 13:03编辑过]