Convert.ToChar (Int32) converts 32-bit signed integer to Unicode character.
Class Sample
Public Shared Sub Main()
Dim numbers() As Integer = { -1, 0, Int32.MaxValue }
Dim result As Char
For Each number As Integer 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