NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Char.FromString

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;

Parameters

s
The string converted to a character.

Return Value

The only character in the string.

Exceptions

Exception Type Condition
ArgumentNullException If the string is null.
FormatException If the string is not equal to one.

Remarks

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.

See Also

Char Structure | Char Members | System Namespace