Esc

grapheme_count

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

Counts extended grapheme clusters without allocation. Example: count, error := grapheme_count("éx"); gives 2.

Signature

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

See also