System.Char Structure

public struct Char : IComparable, IComparable<Char>, IEquatable<Char>

Base Types

Object
  ValueType
    Char

This type implements IComparable, System.IComparable<System.Char>, and System.IEquatable<System.Char>.

Assembly

mscorlib

Library

BCL

Summary

Represents a Unicode character.

Description

The Char value type represents Unicode characters, with code points ranging from 0 to 65,535.

[Note: The code point of a Unicode character is that character's 2-byte, encoded value.]

[Note: The UnicodeCategory enumeration describes the categories that a Unicode character can be mapped to. For information on mapping specific Unicode characters to Unicode categories, see the UnicodeData.txt file in the Unicode Character Database at http://www.unicode.org/Public/UNIDATA/UnicodeCharacterDatabase.html. The UnicodeData.txt file format is described at http://www.unicode.org/Public/3.1-Update/UnicodeData-3.1.0.html.]

See Also

System Namespace

Members

Char Methods

Char.CompareTo(char) Method
Char.CompareTo(System.Object) Method
Char.Equals(char) Method
Char.Equals(System.Object) Method
Char.GetHashCode Method
Char.GetNumericValue(System.String, int) Method
Char.GetNumericValue(char) Method
Char.GetUnicodeCategory(System.String, int) Method
Char.GetUnicodeCategory(char) Method
Char.IsControl(System.String, int) Method
Char.IsControl(char) Method
Char.IsDigit(System.String, int) Method
Char.IsDigit(char) Method
Char.IsLetter(char) Method
Char.IsLetter(System.String, int) Method
Char.IsLetterOrDigit(char) Method
Char.IsLetterOrDigit(System.String, int) Method
Char.IsLower(char) Method
Char.IsLower(System.String, int) Method
Char.IsNumber(char) Method
Char.IsNumber(System.String, int) Method
Char.IsPunctuation(char) Method
Char.IsPunctuation(System.String, int) Method
Char.IsSeparator(System.String, int) Method
Char.IsSeparator(char) Method
Char.IsSurrogate(System.String, int) Method
Char.IsSurrogate(char) Method
Char.IsSymbol(char) Method
Char.IsSymbol(System.String, int) Method
Char.IsUpper(System.String, int) Method
Char.IsUpper(char) Method
Char.IsWhiteSpace(System.String, int) Method
Char.IsWhiteSpace(char) Method
Char.Parse Method
Char.ToLower Method
Char.ToString() Method
Char.ToString(System.IFormatProvider) Method
Char.ToUpper Method

Char Fields

Char.MaxValue Field
Char.MinValue Field


Char.CompareTo(char) Method

public int CompareTo(char value);

Summary

Returns the sort order of the current instance compared to the specified Char .

Parameters

value
The Char to compare to the current instance.

Return Value

The return value is a negative number, zero, or a positive number reflecting the sort order of the current instance as compared to value. For non-zero return values, the exact value returned by this method is unspecified. The following table defines the return value:

Return ValueDescription
A negative numberCurrent instance < value.
ZeroCurrent instance == value.
A positive numberCurrent instance > value.

Description

The comparison performed by this method is based on the code points of the current instance and value, not necessarily their lexicographical characteristics.

[Note: This method is implemented to support the System.IComparable<Char> interface.]

See Also

System.Char Structure, System Namespace

Char.CompareTo(System.Object) Method

public int CompareTo(object value);

Summary

Returns the sort order of the current instance compared to the specified Object .

Parameters

value
The Object to compare to the current instance.

Return Value

The return value is a negative number, zero, or a positive number reflecting the sort order of the current instance as compared to value. For non-zero return values, the exact value returned by this method is unspecified. The following table defines the return value:

Return ValueDescription
A negative numberCurrent instance < value.
ZeroCurrent instance == value.
A positive numberCurrent instance > value, or value is a null reference.

Exceptions

Exception TypeCondition
ArgumentExceptionvalue is not a Char and is not a null reference.

Description

The comparison performed by this method is based on the code points of the current instance and value, not necessarily their lexicographical characteristics.

[Note: This method is implemented to support the IComparable interface.]

See Also

System.Char Structure, System Namespace

Char.Equals(char) Method

public override bool Equals(char obj);

Summary

Determines whether the current instance and the specified Char represent the same value.

Parameters

obj
The Char to compare to the current instance.

Return Value

true if obj represents the same value as the current instance; otherwise, false .

Description

The comparison performed by this method is based on the code points of the current instance and obj, not necessarily their lexicographical characteristics.

[Note: This method is implemented to support the System.IEquatable<Char> interface.]

See Also

System.Char Structure, System Namespace

Char.Equals(System.Object) Method

public override bool Equals(object obj);

Summary

Determines whether the current instance and the specified Object represent the same type and value.

Parameters

obj
The Object to compare to the current instance.

Return Value

true if obj represents the same type and value as the current instance. If obj is a null reference or is not an instance of Char, returns false .

Description

The comparison performed by this method is based on the code points of the current instance and obj, not necessarily their lexicographical characteristics.

[Note: This method overrides System.Object.Equals(System.Object).]

See Also

System.Char Structure, System Namespace

Char.GetHashCode Method

public override int GetHashCode();

Summary

Generates a hash code for the current instance.

Return Value

A Int32 value containing a hash code for the current instance.

Description

The algorithm used to generate the hash code is unspecified.

[Note: This method overrides System.Object.GetHashCode.]

See Also

System.Char Structure, System Namespace

Char.GetNumericValue(System.String, int) Method

public static double GetNumericValue(string s, int index);

Summary

Returns the numeric value associated with the Unicode character at the specified position in the specified String.

Parameters

s
A String.
index
A Int32 that specifies the position of a character in s.

Return Value

A Double representing the numeric value associated with the Char at position index in s if and only if that Char has an associated numeric value; otherwise, -1.0.

Exceptions

Exception TypeCondition
ArgumentNullExceptions is a null reference.
ArgumentOutOfRangeExceptionThe value of index is less than zero, or greater than or equal to the length of s.

Description

A character has an associated numeric value if and only if it is a member of one of the following categories in UnicodeCategory: System.Globalization.UnicodeCategory.DecimalDigitNumber, System.Globalization.UnicodeCategory.LetterNumber, or System.Globalization.UnicodeCategory.OtherNumber .

Library

ExtendedNumerics

See Also

System.Char Structure, System Namespace

Char.GetNumericValue(char) Method

public static double GetNumericValue(char c);

Summary

Returns the numeric value associated with the specified Unicode character.

Parameters

c
A Unicode character.

Return Value

A Double representing the numeric value associated with c if and only if c has an associated numeric value; otherwise, -1.0.

Description

A character has an associated numeric value if and only if it is a member of one of the following categories in UnicodeCategory: System.Globalization.UnicodeCategory.DecimalDigitNumber, System.Globalization.UnicodeCategory.LetterNumber, or System.Globalization.UnicodeCategory.OtherNumber.

Example

The following example demonstrates the System.Char.GetNumericValue(System.Char) method.

using System;
public class GetNumericValueExample {
public static void Main() {
   Char[] cAry = {'8', 'V', Convert.ToChar(0X00BC)};
   //Unicode U+00BC is the code point for the character 
   //representation of 1/4
   foreach(Char c in cAry) {
      Console.Write("Numeric value of Unicode " +
                    "character {0} ", c);
      Console.WriteLine(" is {0}",
                        Char.GetNumericValue(c));
   }
}
}
The output is

Numeric value of Unicode character 8 is 8

Numeric value of Unicode character V is -1

Numeric value of Unicode character is 0.25

Library

ExtendedNumerics

See Also

System.Char Structure, System Namespace

Char.GetUnicodeCategory(System.String, int) Method

public static UnicodeCategory GetUnicodeCategory(string s, int index);

Summary

Determines the UnicodeCategory of the character at the specified position in the specified String .

Parameters

s
A String.
index
A Int32 that specifies the position of a character in s.

Return Value

The UnicodeCategory of the Char at position index in s.

Exceptions

Exception TypeCondition
ArgumentNullExceptions is a null reference.
ArgumentOutOfRangeExceptionThe value of index is less than zero, or greater than or equal to the length of s.

Description

[Note: For more information regarding Unicode categories, see UnicodeCategory.]

See Also

System.Char Structure, System Namespace

Char.GetUnicodeCategory(char) Method

public static UnicodeCategory GetUnicodeCategory(char c);

Summary

Determines the UnicodeCategory of the specified Unicode character.

Parameters

c
A Unicode character.

Return Value

The UnicodeCategory of c.

Description

[Note: For more information regarding Unicode categories, see UnicodeCategory.]

See Also

System.Char Structure, System Namespace

Char.IsControl(System.String, int) Method

public static bool IsControl(string s, int index);

Summary

Determines whether the character at the specified position in the specified String is a control character.

Parameters

s
A String.
index
A Int32 that specifies a character position in s.

Return Value

true if the character at position index in s is a member of the following category in UnicodeCategory: System.Globalization.UnicodeCategory.Control; otherwise, false .

Exceptions

Exception TypeCondition
ArgumentNullExceptions is a null reference.
ArgumentOutOfRangeExceptionThe value of index is less than zero, or greater than or equal to the length of s.

See Also

System.Char Structure, System Namespace

Char.IsControl(char) Method

public static bool IsControl(char c);

Summary

Determines whether the specified Unicode character is a control character.

Parameters

c
A Unicode character.

Return Value

true if c is a member of the following category in UnicodeCategory: System.Globalization.UnicodeCategory.Control; otherwise, false .

See Also

System.Char Structure, System Namespace

Char.IsDigit(System.String, int) Method

public static bool IsDigit(string s, int index);

Summary

Determines whether the character at the specified position in the specified String is a decimal digit.

Parameters

s
A String.
index
A Int32 that specifies a character position in s.

Return Value

true if the character at position index in s is a member of the following category in UnicodeCategory: System.Globalization.UnicodeCategory.DecimalDigitNumber; otherwise, false .

Exceptions

Exception TypeCondition
ArgumentNullExceptions is a null reference.
ArgumentOutOfRangeExceptionThe value of index is less than zero, or greater than or equal to the length of s.

Description

[Note: System.Char.IsDigit(System.Char) determines if a Char is a radix-10 digit. This contrasts with System.Char.IsNumber(System.Char), which determines if a Char is of any numeric Unicode category.]

See Also

System.Char Structure, System Namespace

Char.IsDigit(char) Method

public static bool IsDigit(char c);

Summary

Determines whether a Unicode character is a decimal digit.

Parameters

c
A Unicode character.

Return Value

true if c is a member of the following category in UnicodeCategory: System.Globalization.UnicodeCategory.DecimalDigitNumber; otherwise, false .

Description

[Note: System.Char.IsDigit(System.Char) determines if a Char is a radix-10 digit. This contrasts with System.Char.IsNumber(System.Char), which determines if a Char is of any numeric Unicode category.]

See Also

System.Char Structure, System Namespace

Char.IsLetter(char) Method

public static bool IsLetter(char c);

Summary

Determines whether the specified Unicode character is a letter.

Parameters

c
A Unicode character.

Return Value

true if c is a member of one of the following categories in UnicodeCategory: System.Globalization.UnicodeCategory.UppercaseLetter, System.Globalization.UnicodeCategory.LowercaseLetter, System.Globalization.UnicodeCategory.TitlecaseLetter, System.Globalization.UnicodeCategory.ModifierLetter, or System.Globalization.UnicodeCategory.OtherLetter; otherwise, false .

See Also

System.Char Structure, System Namespace

Char.IsLetter(System.String, int) Method

public static bool IsLetter(string s, int index);

Summary

Determines whether the character at the specified position in the specified String is a letter.

Parameters

s
A String.
index
A Int32 that specifies a character position in s.

Return Value

true if the character at position index in s is a member of one of the following categories in UnicodeCategory: System.Globalization.UnicodeCategory.UppercaseLetter, System.Globalization.UnicodeCategory.LowercaseLetter, System.Globalization.UnicodeCategory.TitlecaseLetter, System.Globalization.UnicodeCategory.ModifierLetter, or System.Globalization.UnicodeCategory.OtherLetter; otherwise, false .

Exceptions

Exception TypeCondition
ArgumentNullExceptions is a null reference.
ArgumentOutOfRangeExceptionThe value of index is less than zero, or greater than or equal to the length of s.

See Also

System.Char Structure, System Namespace

Char.IsLetterOrDigit(char) Method

public static bool IsLetterOrDigit(char c);

Summary

Determines whether the specified Unicode character is either a letter or a decimal digit.

Parameters

c
A Unicode character.

Return Value

true if c is a member of one of the following categories in UnicodeCategory: System.Globalization.UnicodeCategory.UppercaseLetter, System.Globalization.UnicodeCategory.LowercaseLetter, System.Globalization.UnicodeCategory.TitlecaseLetter, System.Globalization.UnicodeCategory.ModifierLetter, System.Globalization.UnicodeCategory.OtherLetter, or System.Globalization.UnicodeCategory.DecimalDigitNumber; otherwise, false .

See Also

System.Char Structure, System Namespace

Char.IsLetterOrDigit(System.String, int) Method

public static bool IsLetterOrDigit(string s, int index);

Summary

Determines whether the character at the specified position in the specified String is either a letter or a decimal digit.

Parameters

s
A String.
index
A Int32 that specifies a character position in s.

Return Value

true if the character at position index in s is a member of one of the following categories in UnicodeCategory: System.Globalization.UnicodeCategory.UppercaseLetter, System.Globalization.UnicodeCategory.LowercaseLetter, System.Globalization.UnicodeCategory.TitlecaseLetter, System.Globalization.UnicodeCategory.ModifierLetter, System.Globalization.UnicodeCategory.OtherLetter, or System.Globalization.UnicodeCategory.DecimalDigitNumber; otherwise, false .

Exceptions

Exception TypeCondition
ArgumentNullExceptions is a null reference.
ArgumentOutOfRangeExceptionThe value of index is less than zero, or greater than or equal to the length of s.

See Also

System.Char Structure, System Namespace

Char.IsLower(char) Method

public static bool IsLower(char c);

Summary

Determines whether the specified Unicode character is a lowercase letter.

Parameters

c
A Unicode character.

Return Value

true if c is a member of the following category in UnicodeCategory: System.Globalization.UnicodeCategory.LowercaseLetter; otherwise, false .

See Also

System.Char Structure, System Namespace

Char.IsLower(System.String, int) Method

public static bool IsLower(string s, int index);

Summary

Determines whether the character at the specified position in the specified String is a lowercase letter.

Parameters

s
A String.
index
A Int32 that specifies a character position in s.

Return Value

true if the character at position index in s is a member of the following category in UnicodeCategory:System.Globalization.UnicodeCategory.LowercaseLetter; otherwise, false .

Exceptions

Exception TypeCondition
ArgumentNullExceptions is a null reference.
ArgumentOutOfRangeExceptionThe value of index is less than zero, or greater than or equal to the length of s.

See Also

System.Char Structure, System Namespace

Char.IsNumber(char) Method

public static bool IsNumber(char c);

Summary

Determines whether the specified Unicode character is a number.

Parameters

c
A Unicode character.

Return Value

true if c is a member of one of the following categories in UnicodeCategory: System.Globalization.UnicodeCategory.DecimalDigitNumber, System.Globalization.UnicodeCategory.LetterNumber, or System.Globalization.UnicodeCategory.OtherNumber; otherwise, false .

Description

[Note: System.Char.IsNumber(System.Char) determines if a Char is of any numeric Unicode category. This contrasts with System.Char.IsDigit(System.Char), which determines if a Char is a radix-10 digit.]

See Also

System.Char Structure, System Namespace

Char.IsNumber(System.String, int) Method

public static bool IsNumber(string s, int index);

Summary

Determines whether the character at the specified position in the specified String is a number.

Parameters

s
A String.
index
A Int32 that specifies a character position in s.

Return Value

true if the character at position index in s is a member of one of the following categories in UnicodeCategory: System.Globalization.UnicodeCategory.DecimalDigitNumber, System.Globalization.UnicodeCategory.LetterNumber, or System.Globalization.UnicodeCategory.OtherNumber; otherwise, false .

Exceptions

Exception TypeCondition
ArgumentNullExceptions is a null reference.
ArgumentOutOfRangeExceptionThe value of index is less than zero, or greater than or equal to the length of s.

Description

[Note: System.Char.IsNumber(System.Char) determines if a Char is of any numeric Unicode category. This contrasts with System.Char.IsDigit(System.Char), which determines if a Char is a radix-10 digit.]

See Also

System.Char Structure, System Namespace

Char.IsPunctuation(char) Method

public static bool IsPunctuation(char c);

Summary

Determines whether the specified Unicode character is a punctuation mark.

Parameters

c
A Unicode character.

Return Value

true if c is a member of one of the following categories in UnicodeCategory: System.Globalization.UnicodeCategory.ConnectorPunctuation, System.Globalization.UnicodeCategory.DashPunctuation, System.Globalization.UnicodeCategory.OpenPunctuation, System.Globalization.UnicodeCategory.ClosePunctuation, System.Globalization.UnicodeCategory.InitialQuotePunctuation, System.Globalization.UnicodeCategory.FinalQuotePunctuation, or System.Globalization.UnicodeCategory.OtherPunctuation; otherwise, false .

See Also

System.Char Structure, System Namespace

Char.IsPunctuation(System.String, int) Method

public static bool IsPunctuation(string s, int index);

Summary

Determines whether the character at the specified position in the specified String is a punctuation mark.

Parameters

s
A String.
index
A Int32 that specifies a character position in s.

Return Value

true if the character at position index in s is a member of one of the following categories in UnicodeCategory: System.Globalization.UnicodeCategory.ConnectorPunctuation, System.Globalization.UnicodeCategory.DashPunctuation, System.Globalization.UnicodeCategory.OpenPunctuation, System.Globalization.UnicodeCategory.ClosePunctuation, System.Globalization.UnicodeCategory.InitialQuotePunctuation, System.Globalization.UnicodeCategory.FinalQuotePunctuation, or System.Globalization.UnicodeCategory.OtherPunctuation; otherwise, false .

Exceptions

Exception TypeCondition
ArgumentNullExceptions is a null reference.
ArgumentOutOfRangeExceptionThe value of index is less than zero, or greater than or equal to the length of s.

See Also

System.Char Structure, System Namespace

Char.IsSeparator(System.String, int) Method

public static bool IsSeparator(string s, int index);

Summary

Determines whether the character at the specified position in the specified String is a separator character.

Parameters

s
A String.
index
A Int32 that specifies a character position in s.

Return Value

true if the character at position index in s is a member of one of the following categories in UnicodeCategory: System.Globalization.UnicodeCategory.SpaceSeparator, System.Globalization.UnicodeCategory.LineSeparator, or System.Globalization.UnicodeCategory.ParagraphSeparator; otherwise, false .

Exceptions

Exception TypeCondition
ArgumentNullExceptions is a null reference.
ArgumentOutOfRangeExceptionThe value of index is less than zero, or greater than or equal to the length of s.

See Also

System.Char Structure, System Namespace

Char.IsSeparator(char) Method

public static bool IsSeparator(char c);

Summary

Determines whether the specified Unicode character is a separator character.

Parameters

c
A Unicode character.

Return Value

true if c is a member of one of the following categories in UnicodeCategory: System.Globalization.UnicodeCategory.SpaceSeparator, System.Globalization.UnicodeCategory.LineSeparator, or System.Globalization.UnicodeCategory.ParagraphSeparator; otherwise, false .

See Also

System.Char Structure, System Namespace

Char.IsSurrogate(System.String, int) Method

public static bool IsSurrogate(string s, int index);

Summary

Determines whether the character at the specified position in the specified String is a surrogate character.

Parameters

s
A String.
index
A Int32 that specifies a character position in s.

Return Value

true if the character at position index in s is a member of the following category in UnicodeCategory: System.Globalization.UnicodeCategory.Surrogate; otherwise, false .

Exceptions

Exception TypeCondition
ArgumentNullExceptions is a null reference.
ArgumentOutOfRangeExceptionThe value of index is less than zero, or greater than or equal to the length of s.

See Also

System.Char Structure, System Namespace

Char.IsSurrogate(char) Method

public static bool IsSurrogate(char c);

Summary

Determines whether the specified Unicode character is a surrogate character.

Parameters

c
A Unicode character.

Return Value

true if c is a member of the following category in UnicodeCategory: System.Globalization.UnicodeCategory.Surrogate; otherwise, false .

See Also

System.Char Structure, System Namespace

Char.IsSymbol(char) Method

public static bool IsSymbol(char c);

Summary

Determines whether the specified Unicode character is a symbol character.

Parameters

c
A Unicode character.

Return Value

true if c is a member of one of the following categories in UnicodeCategory: System.Globalization.UnicodeCategory.MathSymbol, System.Globalization.UnicodeCategory.CurrencySymbol, System.Globalization.UnicodeCategory.ModifierSymbol, or System.Globalization.UnicodeCategory.OtherSymbol; otherwise, false .

See Also

System.Char Structure, System Namespace

Char.IsSymbol(System.String, int) Method

public static bool IsSymbol(string s, int index);

Summary

Determines whether the character at the specified position in the specified String is a symbol character.

Parameters

s
A String.
index
A Int32 that specifies a character position in s.

Return Value

true if the character at position index in s is a member of one of the following categories in UnicodeCategory: System.Globalization.UnicodeCategory.MathSymbol, System.Globalization.UnicodeCategory.CurrencySymbol, System.Globalization.UnicodeCategory.ModifierSymbol, or System.Globalization.UnicodeCategory.OtherSymbol; otherwise, false .

Exceptions

Exception TypeCondition
ArgumentNullExceptions is a null reference.
ArgumentOutOfRangeExceptionThe value of index is less than zero, or greater than or equal to the length of s.

See Also

System.Char Structure, System Namespace

Char.IsUpper(System.String, int) Method

public static bool IsUpper(string s, int index);

Summary

Determines whether the character at the specified position in the specified String is an uppercase letter.

Parameters

s
A String.
index
A Int32 that specifies a character position in s.

Return Value

true if the character at position index in s is a member of the following category in UnicodeCategory: System.Globalization.UnicodeCategory.UppercaseLetter; otherwise, false .

Exceptions

Exception TypeCondition
ArgumentNullExceptions is a null reference.
ArgumentOutOfRangeExceptionThe value of index is less than zero, or greater than or equal to the length of s.

See Also

System.Char Structure, System Namespace

Char.IsUpper(char) Method

public static bool IsUpper(char c);

Summary

Determines whether the specified Unicode character is an uppercase letter.

Parameters

c
A Unicode character.

Return Value

true if c is a member of the following category in UnicodeCategory: System.Globalization.UnicodeCategory.UppercaseLetter; otherwise, false .

See Also

System.Char Structure, System Namespace

Char.IsWhiteSpace(System.String, int) Method

public static bool IsWhiteSpace(string s, int index);

Summary

Determines whether the character at the specified position in the specified String is a whitespace character.

Parameters

s
A String.
index
A Int32 that specifies a character position in s.

Return Value

true if the character at position index in s either has a code point of 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x0085, 0x2028, or 0x2029; or is a member of the following category in UnicodeCategory: System.Globalization.UnicodeCategory.SpaceSeparator; otherwise, false .

Exceptions

Exception TypeCondition
ArgumentNullExceptions is a null reference.

ArgumentOutOfRangeExceptionThe value of index is less than zero, or greater than or equal to the length of s.

See Also

System.Char Structure, System Namespace

Char.IsWhiteSpace(char) Method

public static bool IsWhiteSpace(char c);

Summary

Determines whether the specified Unicode character is a whitespace character.

Parameters

c
A Unicode character.

Return Value

true if c either has a code point of 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x0085, 0x2028, or 0x2029; or is a member of the following category in UnicodeCategory: System.Globalization.UnicodeCategory.SpaceSeparator; otherwise, false .

See Also

System.Char Structure, System Namespace

Char.Parse Method

public static char Parse(string s);

Summary

Returns the specified String converted to a Char value.

Parameters

s
A String containing a single Unicode character.

Return Value

The Char value obtained from s.

Exceptions

Exception TypeCondition
ArgumentNullExceptions is a null reference.
FormatExceptions does not contain exactly one character.

See Also

System.Char Structure, System Namespace

Char.ToLower Method

public static char ToLower(char c);

Summary

Converts a Char to its lowercase equivalent.

Parameters

c
A Unicode character.

Return Value

The lowercase equivalent of c, or the value of c if and only if c is already lowercase or does not have a lowercase equivalent.

Example

The following example demonstrates the System.Char.ToLower(System.Char,System.Globalization.CultureInfo) method.

using System;
public class CharToLower {
   public static void Main() {
      Char[] cAry = {'A', 'c', '*'};
      foreach (Char c in cAry) {
         Console.Write("Char '{0}' ToLower is ", c);
         Console.WriteLine("{0}", Char.ToLower(c));
      }
   }
}
The output is

Char 'A' ToLower is a

Char 'c' ToLower is c

Char '*' ToLower is *

See Also

System.Char Structure, System Namespace

Char.ToString() Method

public override string ToString();

Summary

Returns a String representation of the value of the current instance.

Return Value

A String representation of the current instance.

Description

[Note: This method overrides System.Object.ToString.]

See Also

System.Char Structure, System Namespace

Char.ToString(System.IFormatProvider) Method

public string ToString(IFormatProvider provider);

Summary

Converts the value of this instance to its equivalent String representation using the specified culture-specific format information.

Parameters

provider
(Reserved) An IFormatProvider interface implementation that supplies culture-specific formatting information.

Return Value

The String representation of the value of this instance as specified by provider.

Description

provider is ignored; it does not participate in this operation.

See Also

System.Char Structure, System Namespace

Char.ToUpper Method

public static char ToUpper(char c);

Summary

Converts a Char to its uppercase equivalent.

Parameters

c
A Unicode character.

Return Value

The uppercase equivalent of c, or the value of c if and only if c is already uppercase or does not have an uppercase equivalent.

Example

The following example demonstrates the System.Char.ToUpper(System.Char,System.Globalization.CultureInfo) method.

using System;
public class CharToUpper {
   public static void Main() {
      Char[] cAry = {'A', 'c', '*'};
      foreach (Char c in cAry) {
         Console.Write("Char '{0}' ToUpper is {1}",
                       c, Char.ToUpper(c));
         Console.WriteLine();
      }
   }
}
The output is

Char 'A' ToUpper is A

Char 'c' ToUpper is C

Char '*' ToUpper is *

See Also

System.Char Structure, System Namespace

Char.MaxValue Field

public const char MaxValue = (char)0xFFFF;

Summary

Contains the maximum code point for the Char type.

Description

The numeric value of this constant is 65,535.

See Also

System.Char Structure, System Namespace

Char.MinValue Field

public const char MinValue = (char)0x0;

Summary

Contains the minimum code point for the Char type.

Description

The numeric value of this constant is 0.

See Also

System.Char Structure, System Namespace