class Uni

A string of Unicode codepoints
class Uni 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.

Methods

method new

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

Creates a new Uni instance from the given codepoint numbers.

method list

method list(Uni:D:)

Returns a Seq of integer codepoints.

method NFC

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

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

method NFD

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

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

method NFKC

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

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

method NFKD

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

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

method codes

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

Returns the number of codepoints in the invocant.

method elems

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

Returns the number of codepoints in the invocant.

See Also

class Array

Sequence of itemized values

class Bag

Immutable collection of distinct objects with integer weights

class BagHash

Mutable collection of distinct objects with integer weights

class Capture

Argument list suitable for passing to a Signature

class Hash

Mapping from strings to itemized values

class IterationBuffer

Low level storage of positional values

class List

Sequence of values

class Map

Immutable mapping from strings to values

class Mix

Immutable collection of distinct objects with Real weights

class MixHash

Mutable collection of distinct objects with Real weights

class NFC

Codepoint string in Normal Form C (composed)

class NFD

Codepoint string in Normal Form D (decomposed)

class NFKC

Codepoint string in Normal Form KC (compatibility composed)

class NFKD

Codepoint string in Normal Form KD (compatibility decomposed)

class Pair

Key/value pair

class PseudoStash

Stash type for pseudo-packages

class Range

Interval of ordered values

class Seq

An iterable, potentially lazy sequence of values

class Set

Immutable collection of distinct objects

class SetHash

Mutable collection of distinct objects

class Slip

A kind of List that automatically flattens into an outer container

class Stash

Table for "our"-scoped symbols

class utf8

Mutable uint8 buffer for utf8 binary data

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.