Converts a non-empty String of length 1 to a character.
[Visual Basic] Overloads Public Shared Function ToChar( _ ByVal value As String _ ) As Char [C#] public static char ToChar( string value ); [C++] public: static __wchar_t ToChar( String* value ); [JScript] public static function ToChar( value : String ) : Char;
The character at index 0 within value .
Exception Type | Condition |
---|---|
ArgumentException | If value is null.
If value is not a string of length 1. |
FormatException | If value is not a string of length 1 or is String.Empty. |
Convert Class | Convert Members | System Namespace | Convert.ToChar Overload List