VBA 使用StrConv将单字节字符的字节数组转换为字符串
本文向大家介绍VBA 使用StrConv将单字节字符的字节数组转换为字符串,包括了VBA 使用StrConv将单字节字符的字节数组转换为字符串的使用技巧和注意事项,需要的朋友参考一下
示例
'Declare an array of bytes, assign single-byte character codes, and convert to a string Dim singleByteChars(4) As Byte singleByteChars(0) = 72 singleByteChars(1) = 101 singleByteChars(2) = 108 singleByteChars(3) = 108 singleByteChars(4) = 111 Dim stringFromSingleByteChars As String stringFromSingleByteChars = StrConv(singleByteChars, vbUnicode) 'stringFromSingleByteChars = "Hello"