Convert.ToChar Method (Byte)


Converts the value of the specified 8-bit unsigned integer to its equivalent Unicode character.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

Public Shared Function ToChar (
	value As Byte
) As Char


Type: System.Byte

The 8-bit unsigned integer to convert.

Return Value

Type: System.Char

A Unicode character that is equivalent to value.

The following example converts an array of unsigned bytes to Char values.

Dim bytes() As Byte = {Byte.MinValue, 40, 80, 120, 180, Byte.MaxValue}
Dim result As Char
For Each number As Byte In bytes
   result = Convert.ToChar(number)
   Console.WriteLine("{0} converts to '{1}'.", number, result)
' The example displays the following output:
'       0 converts to ' '.
'       40 converts to '('.
'       80 converts to 'P'.
'       120 converts to 'x'.
'       180 converts to '''.
'       255 converts to 'ÿ'.      

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top