Esc

segments

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

Creates a byte-offset iterator. Words include punctuation and spaces; no dictionary tailoring. Example: iter := segments("hello world", .WORD); then call next_segment(*iter).

Signature

segments :: (
    text: string,
    kind: Segmentation,
    options: Unicode_Text_Options = .{}
) -> Segment_Iterator

See also