如何将十进制的字符串转成十六进制的字节数组?

例如: String str = "2345"; 他的十六进制就是"0x929" 现在我要结果是byte [] hexBytes = {09,29}; 求解.

dim meStr as String '将要转换的字符串
dim i as Integer '
dim meHex() as Byte '存放将转换后的10进制数组
dim strCount as Integer

meSte="2345"
strCount=Len(meStr)
ReDim meHex(strCount)

For i=0 to strCount
meHex(i)=Hex(Asc(Mid$(meStr,i+1,1)))
Next i
将字符串按位进行转换,并存放在16进制的数组中
温馨提示:答案为网友推荐,仅供参考
相似回答