vb判断字符串中含有繁体

解决方案 »

  1.   

    Public Function checkhz(iChar As String) As String
        Dim asc1 As Integer, d1 As String, d2 As String
        asc1 = Asc(iChar)
        If asc1 >= 0 Then
            checkhz= "en"
        Else
            hstr = Hex(asc1)
            d2 = Left(hstr, 2)
            d1 = Right(hstr, 2)
            If d1 >= "A0" And d1 <= "FE" And _
                d2 >= "A0" And d2 <= "FE" Then
                    checkhz= "简体"
            ElseIf d1 >= "80" And d1 <= "FF" And _
                d2 >= "00" And d2 <= "FF" Then
                 checkhz= "繁体"
            Else
                checkhz= "other"
            End If
            
        End If
    End FunctionPrivate Sub Command1_Click()
        MsgBox checkhz("中")
    End Sub
      

  2.   

    http://ff.163.com/newflyff/gbk-list/
      

  3.   

    2楼的是对一个汉字判断的,那如何对一串字符判断呢
    比如对【你好123abc】判断其中含有123abc字母