struct TextSegment::Grapheme::Cluster
- TextSegment::Grapheme::Cluster
- Struct
- Value
- Object
Overview
Unicode extended grapheme cluster. Graphemes
Iterator will return an instance of this struct to return information about specific grapheme cluster.
Defined in:
grapheme/grapheme.crInstance Method Summary
-
#bytes
returns a byte slice which corresponds to the current grapheme cluster.
-
#codepoints : Array(Int32)
Returns codepoints which corresponds to the current grapheme cluster.
-
#positions : Tuple(Int32, Int32)
returns the interval of the current grapheme as byte positions into the original string.
-
#str
returns a substring of the original string which corresponds to the current grapheme cluster
Instance Method Detail
Returns codepoints which corresponds to the current grapheme cluster.
returns the interval of the current grapheme as byte positions into the
original string. The first returned value "from" indexes the first byte
and the second retured value "to" indexes the first byte that is not included
anumore, i.e. str[from...to]
is the current grapheme cluster of
the original string "str".
returns a substring of the original string which corresponds to the current grapheme cluster