The offset where the grapheme cluster that ends at index starts. Returns 0 at the start.
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