strText = ("中文123")
WScript.Echo(strText & ":" & Len(strText))
WScript.Echo(strText & ":" & newLen(strText))
Function newLen(text)
oldlen = Len(text)
newLen = 0
For i = 1 To oldlen
If Asc(Mid(text,i,1)) > 0 Then
newLen = newLen + 1
Else
newLen = newLen + 2
End If
Next
End Function
No comments:
Post a Comment