| 用VBA统计字符串中的中文字个数 |
|
| 作者:朱亦文 文章来源:原创 点击数: 本日:{$DayHits} 更新时间:2006-3-19 22:25:45 |
用VBA统计字符串中的中文字个数
' 统计中文字的个数 ' 作者:朱亦文 ' 日期:2006.01.05 Function CountZh(ByVal sZh As String) As Integer Dim re As New RegExp Dim matches As MatchCollection re.Pattern = "[\u4e00-\u9fa5]" re.Global = True re.IgnoreCase = True Set matches = re.Execute(sZh) CountZh = matches.Count Set re = Nothing End Function
|
请引用Microsoft VBScript Regular Express 5.5。 |
| 文章录入:zhuyiwen 责任编辑:tm |
|
上一篇文章: 时间延迟
下一篇文章: ACCESS用代码如何压缩与修复带有安全机制工作组的后台文 |
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |