# Re: 能否判断字串是中文或英文

Posted by 小吴 on July 23, 1999 at 09:38:07:

In Reply to: 能否判断字串是中文或英文 posted by CC on July 22, 1999 at 22:19:54:

Dim strSource As String, strResult As String
Dim i As Integer, strChar As String
Dim strEnglish As String, strChinese As String

strSource = "中abc文def"
For i = 1 To Len(strSource)
strChar = Mid$(strSource, i, 1)
Select Case Asc(strChar)
Case 0 To 255 ' 英文
strEnglish = strEnglish & strChar
Case Else ' 中文
strChinese = strChinese & strChar
End Select
Next i

Follow Ups:

- Thanks very much CC 10:41:52 7/23/99 (0)