function find1(findstr) set rep1=new regexp rep1.Global=true rep1.IgnoreCase=true rep1.Pattern="[\u4E00-\u9FA5]" set str1=rep1.Execute(findstr) for each i in str1 lens=lens+1 next lens=lens + len(findstr) msgbox "字符长度 : " & lens end function find1("1234567") find1("大家好1234567")
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
查看更多关于vbs:一段比较精简的代码实现取得字符串的"字节"数的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did91937