Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Struct

Character

struct Character

Module: System
Assembly: System.Runtime.dll
Source file: Character.rvn

Inheritance: Object → ValueType → Character
Implements: ComparableTo<Character>, EquatableTo<Character>

An immutable Unicode extended grapheme cluster backed by preserved UTF-8 text.

Remarks

Character literals infer this type. Equality and hashing use canonical Unicode equivalence; this is not a numeric code unit.

Grapheme identity and migration

Character is one Unicode extended grapheme cluster, preserving its original UTF-8 spelling. It is an immutable value type; equality, hashing and ordering use canonical Unicode equivalence. An explicit StringComparison selects ordinal comparison when byte identity matters. Storage can still allocate: value semantics do not promise allocation-free grapheme construction.

Character literals infer this type. Use Character for explicit annotations; neoCLR no longer has a predefined char alias. This replaces the development System.Char API and requires matching compiler and library artifacts. Raven on .NET continues to use System.Char and UTF-16 code-unit semantics.

See the tested text examples for iteration and comparison.

Methods

9 items
CompareTo(other: Character) -> int Orders canonical NFD scalar sequences, without linguistic collation. Implements ComparableTo<Character>.CompareTo
Equals(other: Character, comparison: StringComparison) -> bool Compares graphemes using an explicit text policy.
Equals(other: Character) -> bool Tests canonical equivalence of graphemes without allocating text. Implements EquatableTo<Character>.Equals
Equals(other: object?) -> bool No summary available. Overrides Object.Equals
Static member: FromString(text: string) -> Character Creates one Character from a complete extended grapheme cluster.
GetHashCode() -> int Hashes canonical grapheme identity without changing stored bytes. Overrides Object.GetHashCode
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
ToString() -> string No summary available. Overrides Object.ToString
Static member: TryFromString(text: string) -> Optional<Character> Creates a Character when text is exactly one extended grapheme cluster.