The offset where the word left of index starts.
assert(previous_word("hello world", 11) == 6);
assert(previous_word("hello world", 6) == 0);previous_word :: (text: string, index: int) -> int
Parameters
- text: string
- index: int
Returns
- int
The offset where the word left of index starts.
assert(previous_word("hello world", 11) == 6);
assert(previous_word("hello world", 6) == 0);previous_word :: (text: string, index: int) -> int