'**************************************************** '函數名: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