方法1
a = "中国"
max1 = Len(a)
ReDim txt1(max1)
For i = 1 To max1
txt1(i) = AscW(Mid(a, i, 1)) 'AscW 返回输入字符的 Unicode 码。
Debug.Print Hex(txt1(i));
next i
方法2
Private Sub Command1_Click()
Dim s As String, a() As Byte
s = "中国"
a = s
text1 = ""
For i = 0 To UBound(a) Step 2
text1 = text1 & Format(Hex(a(i + 1)), "00") & Format(Hex(a(i)), "00") & " "
Next
Debug.Print text1
End Sub
前面已经有例子了,a就是数组,VB内部就是unicode
Private Sub Command1_Click()
Dim txt1 As String
Dim a() As Byte
Dim i As Long
txt1 = "中国"
a = txt1
For i = 0 To UBound(a): Debug.Print a(i);: Next
End Sub
数组内容: 45 78 253 86