Retrieves the first character of a String.
[Visual Basic] Public Shared Function FromString( _ ByVal s As String _ ) As Char [C#] public static char FromString( string s ); [C++] public: static __wchar_t FromString( String* s ); [JScript] public static function FromString( s : String ) : Char;
The only character in the string.
Exception Type | Condition |
---|---|
ArgumentNullException | If the string is null. |
FormatException | If the string is not equal to one. |
The FromString method converts an one-character string to a character. If the provided string is longer than one character, then a FormatException is thrown.