Прочетете на английски Редактиране

Споделяне чрез


Char.Parse(String) Method

Definition

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

public static char Parse(string s);

Parameters

s
String

A string that contains a single character, or null.

Returns

A Unicode character equivalent to the sole character in s.

Exceptions

The length of s is not 1.

Examples

The following code example demonstrates Parse.

using System;

public class ParseSample {
    public static void Main() {
        Console.WriteLine(Char.Parse("A")); // Output: 'A'
    }
}

Applies to

See also