I'd like to convert byte array to char array. Below is what I have:
Dim nbytes As Integer = COMPort.BytesToRead
Dim comBuffer() As Byte = New Byte(nbytes - 1) {} 'create a byte array to hold the awaiting data
COMPort.Read(comBuffer, 0, nbytes) ' {179,254,128,25,170,12}
Dim charArray() As Char
Dim strTemp As String = ""
strTemp = BitConverter.ToString(comBuffer).Replace("-", " ") 'BE FE 80 19 AA 0C
charArray = System.Text.Encoding.ASCII.GetString(comBuffer).ToCharArray()
I can do charArray = strTemp.ToCharArray() but would like to avoid using strTemp if possible.
I need charArray looks to be the same strTemp that is 'BE FE 80 19 AA 0C'. Thanks.