Mega Code Archive

 
Categories / VB.Net / Development
 

BitConverter ToChar returns a Unicode character converted from two bytes at a specified position in a byte array

Imports System Imports Microsoft.VisualBasic Module BytesToCharDemo     Sub BAToChar( bytes( ) As Byte, index As Integer )         Dim value As Char = BitConverter.ToChar( bytes, index )         Console.WriteLine( value )     End Sub      Sub Main( )         Dim byteArray as Byte( ) = {32,   0,   0,  42,   0,  65,   0, 66,   67, 67, 0, 168,   3,  41,   4, 172,  32 }         BAToChar( byteArray, 0 )     End Sub  End Module