Text_Buffer module

next_grapheme

procedureextensionexperimentalsince 0.31.0Source

The offset after the grapheme cluster (what a reader sees as one character) that starts at index. Returns text.count at the end.

Example↗
text := "e\xCC\x81x";  // e + combining acute accent, then x
assert(next_grapheme(text, 0) == 3);
assert(next_grapheme(text, 3) == 4);
next_grapheme :: (text: string, index: int) -> int

Parameters

text: string
index: int

Returns

int

See also