Text_Buffer module

previous_grapheme

procedureextensionexperimentalsince 0.31.0Source

The offset where the grapheme cluster that ends at index starts. Returns 0 at the start.

Example↗
text := "e\xCC\x81x";
assert(previous_grapheme(text, 4) == 3);
assert(previous_grapheme(text, 3) == 0);
previous_grapheme :: (text: string, index: int) -> int

Parameters

text: string
index: int

Returns

int

See also