'原创:获取中英字符串混排长度的过程,中文字长为2。
'需引用 Microsoft VBScript Regular Expressions 5.5 或 Microsoft VBScript Regular Expressions 1.0
Function RegExpTest(BLstr)
Set re = New RegExp
re.IgnoreCase = True
re.Global = True
re.Pattern = "[/x00-/xff]"
reStr = re.Replace(BLstr, "")
reStr = Len(BLstr) + Len(reStr)
RegExpTest = reStr
End Function
'需引用 Microsoft VBScript Regular Expressions 5.5 或 Microsoft VBScript Regular Expressions 1.0
Function RegExpTest(BLstr)
Set re = New RegExp
re.IgnoreCase = True
re.Global = True
re.Pattern = "[/x00-/xff]"
reStr = re.Replace(BLstr, "")
reStr = Len(BLstr) + Len(reStr)
RegExpTest = reStr
End Function
博客给出了一个用VBScript编写的原创函数,用于获取中英字符串混排的长度,其中中文字长计为2。该函数需引用Microsoft VBScript Regular Expressions 5.5或1.0。
2838

被折叠的 条评论
为什么被折叠?



