Text_Buffer module

next_word

procedureextensionexperimentalsince 0.31.0Source

The offset where the word right of index ends. Spaces are skipped first, then a run of word characters or of punctuation. Line breaks are the caller's to handle.

Example↗
assert(next_word("hello world", 0) == 5);
assert(next_word("hello world", 5) == 11);
next_word :: (text: string, index: int) -> int

Parameters

text: string
index: int

Returns

int

See also