你可以用Lenb这个函数啊,它可以取出字节数,举例如下:
Dim strTmp As String
strTmp = "汉"
Debug.Print Len(strTmp) & "-" & LenB(strTmp)会生成
1-2不知道能不能解决你的问题:)
Dim strTmp As String
strTmp = "汉"
Debug.Print Len(strTmp) & "-" & LenB(strTmp)会生成
1-2不知道能不能解决你的问题:)
Dim I As Long
Dim j As Long
j = 0
For I = 1 To Len(a)
If Asc(Mid(a, I, 1)) < 0 Then j = j + 1
Next I
lena = I + j - 1
End Function
返回 Long,其中包含字符串内字符的数目.注意 LenB 函数作用于字符串中的字节数据,如同在双字节字符集(DBCS)语言中一样。所以 LenB 返回的是用于代表字符串的字节数,而不是返回字符串中字符的数量。
BOOL GetTextExtentPoint32(
HDC hdc, // handle to device context
LPCTSTR lpString, // pointer to text string
int cbString, // number of characters in string
LPSIZE lpSize // pointer to structure for string size
);
FROM A VC LEARNER
sorry
返回值是:12