BrowserREPL-button-tip-on BrowserREPL-button-tip-off

EditButtonTip 2024-05-18

class Uni

A string of Unicode codepoints

class Uni does Positional[uint32] does Stringy { }
Code

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.

Methods§

method new§

method new(*@codes --> Uni:D)
Code

Creates a new Uni instance from the given codepoint numbers.

method list§

method list(Uni:D:)
Code

Returns a Seq of integer codepoints.

method NFC§

method NFC(Uni:D: --> NFC:D)
Code

Returns an NFC (Normal Form Composed)-converted version of the invocant.

method NFD§

method NFD(Uni:D: --> NFD:D)
Code

Returns an NFD (Normal Form Decomposed)-converted version of the invocant.

method NFKC§

method NFKC(Uni:D: --> NFKC:D)
Code

Returns an NFKC (Normal Form Compatibility Composed)-converted version of the invocant.

method NFKD§

method NFKD(Uni:D: --> NFKD:D)
Code

Returns an NFKD (Normal Form Compatibility Decomposed)-converted version of the invocant.

method codes§

method codes(Uni:D: --> Int:D)
Code

Returns the number of codepoints in the invocant.

method elems§

method elems(Uni:D: --> Int:D)
Code

Returns the number of codepoints in the invocant.

Class relation diagram§

Rakudo Type Relation for Uni Uni Uni Any Any Uni->Any is Stringy Stringy Uni->Stringy does Positional Positional Uni->Positional does