在VFP中分离中英字符串
How to separate Chinese char & English Char in VFP
LcStr = "Eng Char Test 中文测试EngCHAR中文HELLO中文测试"
LnCount = Len(LcStr)
Clear
LcTmpStr = ''
For i=1 To LnCount
If Between(Asc(Substr(LcStr,i,1)),128,255)
LcTmpChr = Substr(LcStr,i,2)
i=i+1
If IsLeadByte(Rightc(LcTmpStr,1))
LcTmpStr = LcTmpStr + LcTmpChr
Else
LcTmpStr = LcTmpStr+Chr(13)+Chr(10)+LcTmpChr
Endif
Else
LcTmpChr = Substr(LcStr,i,1)
If IsLeadByte(Rightc(LcTmpStr,1))
LcTmpStr = LcTmpStr+Chr(13)+Chr(10)+LcTmpChr
Else
LcTmpStr = LcTmpStr+LcTmpChr
Endif
Endif
Endfor
?LcTmpStr



被折叠的 条评论
为什么被折叠?



