Function StrLength(str)
Dim Rep,lens,i '建立变量
Set rep=new regexp '建立正则表达式
rep.Global=true '设置全局可用性
rep.IgnoreCase=true '设置是否区分字符大小写
rep.Pattern="[/u4E00-/u9FA5/uF900-/uFA2D]" '设置模式
For each i in rep.Execute(str)
lens=lens+1
Next
Set Rep=Nothing
lens=lens + len(str)
strLength=lens '返回长度
End Function
asp计算字符串长度 忽略中英文
最新推荐文章于 2022-09-02 12:08:48 发布