A string of Unicode codepoints
does Positional[uint32] does Stringy
Unlike Str, which is made of Grapheme clusters, Uni is string strictly made of Unicode codepoints. That is, base characters and combining characters are separate elements of a Uni
instance.
Uni
presents itself with a list-like interface of integer Codepoints.
Typical usage of Uni
is through one of its subclasses, NFC
, NFD
, NFKD
and NFKC
, which represent strings in one of the Unicode Normalization Forms of the same name.
method new(* --> Uni)
Creates a new Uni
instance from the given codepoint numbers.
method list(Uni:)
Returns a Seq
of integer codepoints.
method NFC(Uni: --> NFC)
Returns a NFC (Normal Form Composed)-converted version of the invocant.
method NFD(Uni: --> NFD)
Returns a NFD (Normal Form Decomposed)-converted version of the invocant.
method NFKC(Uni: --> NFKC)
Returns a NFKC (Normal Form Compatibility Composed)-converted version of the invocant.
method NFKD(Uni: --> NFKD)
Returns a NFKD (Normal Form Compatibility Decomposed)-converted version of the invocant.
method codes(Uni: --> Int)
Returns the number of codepoints in the invocant.
method elems(Uni: --> Int)
Returns the number of codepoints in the invocant.