namespace sys.core.lang
class Char
A class representing an Unicode codepoint.
It is a 32 bit unsigned values, with a valid range of values consisting of `Invalid` (signaling an error/invalid character) and all values between `Min` (0) and `Max` (0x10FFFF).
It spans the whole valid range of 17 Unicode planes.
def Clamp(min: Char, max: Char);
Clamps the current mutable instance between `min` and `max`.
min | the minimum value |
---|---|
max | the maximum value |
func Clamped(min: Char, max: Char): Char;
Returns the current instance clamped between `min` and `max`.
min | the minimum value |
---|---|
max | the maximum value |
the clamped value
func ToString(): String;
Converts the value to a Utf8 string.
the resulting string
func @write(ref stream: Stream);
func @write(ref stream: Stream, format: OutputFormat);
Writes the value to an Utf8 text stream.
stream | the output stream |
---|---|
format | formatting information |
func @put(ref stream: Stream);
Writes the code point to a binary stream as a 32 bit unsigned integer.
stream | the output stream |
---|
def @get(ref stream: Stream);
Reads the code point a 32 bit unsigned integer from a binary stream.
stream | the input stream |
---|
property IsAsciiDigit: Bool; get;
Returns true if the code point is an ASCII digit.
property IsAsciiAlpha: Bool; get;
Returns true if the code point is an ASCII alphabetic character.
property IsAsciiAlphaNum: Bool; get;
Returns true if the code point is an ASCII alphanumeric character.
property IsAsciiControl: Bool; get;
Returns true if the code point is an ASCII control character.
property IsAsciiGraph: Bool; get;
Returns true if the code point is an ASCII graphical character.
property IsAsciiPrintable: Bool; get;
Returns true if the code point is an ASCII printable character.
property IsAsciiPunct: Bool; get;
Returns true if the code point is an ASCII punctuation character.
property IsAsciiUpper: Bool; get;
Returns true if the code point is an ASCII upper case character.
property IsAsciiLower: Bool; get;
Returns true if the code point is an ASCII lower case character.
property IsAsciiSpace: Bool; get;
Returns true if the code point is an ASCII whitespace character.
property AsciiUpper: Char; get;
Returns the ASCII upper case of the ASCII character.
property AsciiLower: Char; get;
Returns the ASCII lower case of the ASCII character.
property UnicodePlane: Byte; get;
Returns the Unicode plane of the code point, between 0 and 16.
property Category: UnicodeCategory; get;
Returns the Unicode category of the code point.
property Upper: Char; get;
Returns the upper case of the character.
property Lower: Char; get;
Returns the lower case of the character.
property Title: Char; get;
Returns the title case of the character.
property IsUpper: Bool; get;
Returns true if the character is upper case.
property IsLower: Bool; get;
Returns true if the character is lower case.
property IsTitle: Bool; get;
Returns true if the character is title case.
property IsDecimal: Bool; get;
Returns true if the character is an Unicode decimal.
const Zero: Char;
An Char instance representing a logical "0" value.
const Min: Char;
The minimum value for an Char (Unicode code point) instance.
const Max: Char;
The maximum value for an Char (Unicode code point) instance.
const MaxUtf8CP1: Char;
The highest code point that can be represented by 1 Utf8 code unit.
const MaxUtf8CP2: Char;
The highest code point that can be represented by 2 Utf8 code units.
const MaxUtf8CP3: Char;
The highest code point that can be represented by 3 Utf8 code units.
const MaxUtf8CP4: Char;
The highest code point that can be represented by 4 Utf8 code units.
const Invalid: Char;
A constant describing an "invalid" code point.