Skip to content
Prev 347239 / 398500 Next

stringr::str_split_fixed query

Dear David,

str_split_fixed calls str_locate_all, which gives

str_locate_all("ab", "")
## [[1]]
##      start end
## [1,]     1   0
## [2,]     2   1
##

in your example, since "" is a character of length 1. substring() is
probably more intuitive to get your expected result:

substring("ab", 1:2, 1:2)
## [1] "a" "b"


David Barron <dnbarron at gmail.com> schrieb am Wed, 14. Jan 18:47: