Convert.ToChar (UInt32) converts 32-bit unsigned integer to Unicode character.
Class Sample
Public Shared Sub Main()
Dim numbers() As UInteger = { UInt32.MinValue, 40,2011, Int32.MaxValue }
Dim result As Char
For Each number As UInteger 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 'Main
End Class 'Sample
Related examples in the same category