-
Notifications
You must be signed in to change notification settings - Fork 195
Description
This appears to be a bug (either in the docs or the implementation) because the docs suggest that this is supported.
To reproduce:
stringr::str_replace("ABCDEF", "", " ")
Error: Not implemented
stringr::str_replace("ABCDEF", stringr::boundary("character"), " ")
Error: Not implemented
(Also affects str_replace_all().)
While the docs (?str_replace) say (under Arguments)
patternPattern to look for.
The default interpretation is a regular expression, as described in stringi-search-regex. Control options with regex().
Match a fixed string (i.e. by comparing only bytes), using fixed(x). This is fast, but approximate. Generally, for matching human text, you'll want coll(x) which respects character matching rules for the specified locale.
Match character, word, line and sentence boundaries with boundary(). An empty pattern, "", is equivalent to boundary("character").
(Emphasis mine.)
The equivalent does work in str_split():
stringr::str_split("ABCDEF", "")
[[1]]
[1] "A" "B" "C" "D" "E" "F"
stringr::str_split("ABCDEF", stringr::boundary("character"))
[[1]]
[1] "A" "B" "C" "D" "E" "F"