Click or drag to resize
ConvertToChar Method (String)
Converts the first character of a specified string to a Unicode character.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static char ToChar(
	string value
)

Parameters

value
Type: SystemString
A string of length 1.

Return Value

Type: Char
A Unicode character that is equivalent to the first and only character in value.
Exceptions
ExceptionCondition
ArgumentNullExceptionvalue is null.
FormatExceptionThe length of value is not 1.
See Also