'**************************************************** '函数名:StrLength '作 用:取得字符串长度(汉字为2) '参 数:str ----字符串内容 '返回值:字符串长度 '**************************************************** Public 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