last-word ( str -- i )
Word and grapheme breaks
Prev:first-word-from ( start str -- i )
Next:last-word-from ( end str -- i )


Vocabulary
unicode.breaks

Inputs and outputs
stra string
iindex


Word description
Finds the index of the beginning of the last word in the string.

Definition
USING: kernel sequences ;

IN: unicode.breaks

: last-word ( str -- i )
[ length iota ] keep [ word-break-at? ] curry
find-last drop 0 or ;