Char::Parse Method (String^)

 

Converts the value of the specified string to its equivalent Unicode character.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

public:
static wchar_t Parse(
	String^ s
)

Parameters

s
Type: System::String^

A string that contains a single character, or null.

Return Value

Type: System::Char

A Unicode character equivalent to the sole character in s.

Exception Condition
ArgumentNullException

s is null.

FormatException

The length of s is not 1.

The following code example demonstrates Parse.

using namespace System;
int main()
{
   Console::WriteLine( Char::Parse(  "A" ) ); // Output: 'A'
}

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Return to top
Show: