VB中如何把Ascii字符串转换成字符串,比如:“3030”转换成“00”

如题所述

function AscStr2String(byval ascstr as string) as string
while len(ascstr)>1
AscStr2String=AscStr2String & chr(cint(left(ascstr,2))) '取2个字节,转换成字符,每个字符的asc都是2个字节
ascstr=mid(ascstr,3)' 把前两位切掉,从第三位开始
wend
end function
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-04-28
a = "303038363439"
b = ""
For i = 1 To Len(a) Step 2
b = b & Chr("&H" & Mid(a, i, 2))
Next
Print b
第2个回答  2013-04-29
用Chr函数,例如
Chr(65)返回值是A
相似回答
大家正在搜