以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 如何判断字符串中含有中文 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=81032) |
-- 作者:zhsenchzhi -- 发布时间:2016/2/16 22:25:00 -- 如何判断字符串中含有中文 请问 判断一个字符串是否含有中文字符,那种方法效率最高呢? 比如 我要 判断 字符串 MessageBox.Show("如果你认真学习了,你会觉得" & Chr( 中是否含有中文
|
-- 作者:大红袍 -- 发布时间:2016/2/16 22:32:00 -- Dim str As String = "XA0001中国abc" Dim reg As new System.Text.RegularExpressions.Regex("[\\u4e00-\\u9fa5]+") If reg.IsMatch(str) Then msgbox("有中文") Else msgbox("没中文") End If |