stringi
stringi copied to clipboard
str_sub_boundaries ?
Seems like it would make sense to have a version of str_sub()
that let you specify how the string was decomposed into subunits.
I don't get it (?) Could you provide an illustration for that?
I was thinking something like:
words <- "one two three"
stri_sub(words, 1, 2, stri_opt_brkiter("word", skip_word_none = TRUE))
# "one two"
stri_sub(words, 3, 3, stri_opt_brkiter("word", skip_word_none = TRUE)) <- "3"
words
# "one two 3"
i.e. there's some natural equivalence between stri_locate_boundaries()
and stri_sub()
.
[INTERNAL] This is somehow linked with #127 (stri_sub<-
-> stri_replace
, stri_sub
-> stri_extract
)