以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]如何判断字符串中某个位置是不是汉字  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=144464)

--  作者:fstzy
--  发布时间:2019/12/20 22:02:00
--  [求助]如何判断字符串中某个位置是不是汉字
请问老师,如何判断字符串中某个位置是不是汉字?
--  作者:有点蓝
--  发布时间:2019/12/20 22:23:00
--  
Dim pattern As String = "[\\u4e00-\\u9fa5]"
Dim txt = "11放到2483"
Dim rgx = new System.Text.RegularExpressions.Regex(pattern , System.Text.RegularExpressions.RegexOptions.IgnoreCase)
If rgx.isMatch(txt) Then
    msgbox("包含中文")
End If