Esc

previous_grapheme

procedureextensionsince 0.36.1Source
  • macOS: previous_grapheme works on macOS
  • Linux: previous_grapheme works on Linux
  • Windows: previous_grapheme works on Windows
  • Wasm: previous_grapheme works on Wasm

Finds the cluster start before index, backing up to a guaranteed boundary for context. Example: start, error := previous_grapheme("éx", 3); gives 0.

Signature

previous_grapheme :: (
    text: string,
    index: int,
    options: Unicode_Text_Options = .{}
) -> (int, Unicode_Text_Error)

See also