求用vbs转字符串为16进制数组方法
有一个字符串 比如为str = "abababababababababab", 想把它转换为一个16进制的10个元素的数组a[10] = {0xab,0xab,0xab,0xab,0xab,0xab,0xab,0xab,0xab,0xab},求问高手如何操作
[解决办法]
str = "abababababababababab"str2 = ""For i=1 To Len(str) Step 2 If str2 = "" Then str2 = Mid(str,i,2) Else str2 = str2 & "," & Mid(str,i,2) End If Next ar = Split(str2,",")For i=0 To UBound(ar) ar(i) = Hex(clng("&h" & ar(i)))Next