char
Struct · built-in type
struct char : IComparable<char>, IEquatable<char>, IHashableA byte of text, a type of its own that converts implicitly to and from uint8 (and to the larger integer
types). A character literal like 'a' is its ASCII code; arithmetic on it gives an int ('a' + 1 is 98).
A char is one byte of UTF-8, so a character beyond ASCII is several chars. The namespace Char classifies
and converts them (Char.IsDigit(c)).
Methods
Section titled “Methods”| Name | Description |
|---|---|
ToString |
A string of the one character. |
Equals |
Whether the characters are equal (also a == b). |
CompareTo |
Compares the codes: -1, 0 or 1. |
GetHashCode |
A hash code of the character, for Dictionary keys. |
ToString
Section titled “ToString”string ToString()A string of the one character.
Equals
Section titled “Equals”bool Equals(char other)Whether the characters are equal (also a == b).
CompareTo
Section titled “CompareTo”int CompareTo(char other)Compares the codes: -1, 0 or 1.
GetHashCode
Section titled “GetHashCode”int GetHashCode()A hash code of the character, for Dictionary keys.