发信人: hunter__fox(石头)
整理人: hunter__fox(2003-01-09 10:45:07), 站内信件
|
【 在 zhouboy 的大作中提到:】
:如何检测:两个英文字母还是一个中文字?四个英文字母还是两个中文字?六.......
:......
非Ascii编码的字符,如中文,它们的字符最高位为1,因此:
nChi = 0
For n=1 To Len(cString)
If Subst(cString,n,1)> Chr(128)
*=MessageBox('非英文字符')
nChi = nChi +1
n = n + 1
Else
*=MessageBox('英文字符')
EndIf
EndFor
=MessageBox('字串' + cString + '中含有' + Str(nChi) + '个汉字',0) |
|