strs_endswith
determines whether each element of a character vector ends
with a specified suffix. This function is similar to Python's
str.endswith()
method.
Value
A logical vector of the same length as string
, with each element
indicating whether the corresponding element of string
ends with suffix
.
Examples
strs_endswith("hello world", "world")
#> [1] TRUE
strs_endswith(c("test", "hello", "world"), "ld")
#> [1] FALSE FALSE TRUE