C# Char Parse

Description

Char Parse converts the value of the specified string to its equivalent Unicode character.

Syntax

Char.Parse has the following syntax.


public static char Parse(
  string s
)

Parameters

Char.Parse has the following parameters.

  • s - A string that contains a single character, or null.

Returns

Char.Parse method returns A Unicode character equivalent to the sole character in s.

Example

The following code example demonstrates Parse.


/*w w w .j a  v a2 s  . c o m*/
using System;

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

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version