public class Char implements ValueType:
Represents one Unicode scalar value.
A Char stores a valid Unicode code point in U+0000..U+10FFFF, excluding the UTF-16 surrogate range U+D800..U+DFFF. It therefore occupies 32 bits and can represent both Basic Multilingual Plane and supplementary characters without splitting them into surrogate pairs.
Char literals use apostrophes so their meaning cannot be confused with the backtick-delimited 16-bit CodeUnit literal syntax. U+0000 is a valid Char, but cannot be inserted into Klyn's zero-terminated String storage; converting it to text raises ValueException.
letter as Char = 'K' smile as Char = '😀' escaped as Char = '\U0001F600' assert smile == escaped
| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | isAsciiisAscii as Boolean: |
Indicates whether this Char belongs to ASCII. |
| public readonly property | isBMPisBMP as Boolean: |
Indicates whether this Char belongs to the Basic Multilingual Plane. |
| public readonly property | utf16SequenceLengthutf16SequenceLength as UInt: |
Returns the number of UTF-16 code units required for this Char. |
| public readonly property | utf8SequenceLengthutf8SequenceLength as UInt: |
Returns the number of UTF-8 bytes required for this Char. |
| Modifier and Type | Member | Description |
|---|---|---|
| public native | CharChar() |
Builds the neutral Char value (U+0000). |
| public native | Char | Copies another Char. |
| public native | Char | Converts one UTF-16 code unit to a Char. |
| public native | Char | Creates a Char from a signed integer code point. |
| public native | Char | Creates a Char from a signed long code point. |
| public native | Char | Creates a Char from an unsigned integer code point. |
| public native | Char | Creates a Char from an unsigned long code point. |
| Modifier and Type | Member | Description |
|---|---|---|
| public native | isAlnumisAlnum() as Boolean |
Determines whether this Char is alphabetic or a digit. |
| public native | isAlphaisAlpha() as Boolean |
Determines whether this Char belongs to a Unicode alphabetic class. |
| public native | isDigitisDigit() as Boolean |
Determines whether this Char belongs to a Unicode digit class. |
| public native | toInttoInt() as Int |
Returns this Unicode scalar as a signed integer. |
| public native | toLowertoLower() as Char |
Converts this Char to lowercase when a Unicode mapping exists. |
| public native | toUppertoUpper() as Char |
Converts this Char to uppercase when a Unicode mapping exists. |