>graphemes ( str -- graphemes )
Word and grapheme breaks

Prev:last-grapheme-from ( end str -- i )
Next:string-reverse ( str -- rts )


Vocabulary
unicode

Inputs
stra string


Outputs
graphemesan array of strings


Word description
Divides a string into a sequence of individual graphemes.

Definition


:: >graphemes ( str -- graphemes )
str length :> str-len 0 :> pos! 0 :> old-pos! [
f pos old-pos! old-pos str-len <
[ str pos first-grapheme pos + pos! pos str-len <= ]
[ f ] if
] [ drop old-pos pos str <slice> ] produce nip ;