Click or drag to resize
ConvertToChar Method (String, IFormatProvider)
Converts the first character of a specified string to a Unicode character, using specified culture-specific formatting information.

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

Parameters

value
Type: SystemString
A string of length 1 or null.
provider
Type: SystemIFormatProvider
An object that supplies culture-specific formatting information. This parameter is ignored.

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