Convert.ToChar (SByte) converts 8-bit signed integer to Unicode character.
Class Sample
Public Shared Sub Main()
Dim numbers() As SByte = { SByte.MinValue, -1, 40, 80, 120, SByte.MaxValue }
Dim result As Char
For Each number As SByte In numbers
Try
result = Convert.ToChar(number)
Console.WriteLine("{0} converts to '{1}'.", number, result)
Catch e As OverflowException
Console.WriteLine("{0} is outside the range of the Char data type.", _
number)
End Try
Next
End Sub
End Class
Related examples in the same category