R/detect.r
str_starts.RdVectorised over string and pattern.
str_starts(string, pattern, negate = FALSE) str_ends(string, pattern, negate = FALSE)
| string | Input vector. Either a character vector, or something coercible to one. |
|---|---|
| pattern | Pattern with which the string starts or ends. The default interpretation is a regular expression, as described in
stringi::stringi-search-regex. Control options with Match a fixed string (i.e. by comparing only bytes), using |
| negate | If |
A logical vector.
str_detect() which this function wraps when pattern is regex.
#> [1] FALSE FALSE TRUE TRUEstr_starts(fruit, "p", negate = TRUE)#> [1] TRUE TRUE FALSE FALSEstr_ends(fruit, "e")#> [1] TRUE FALSE FALSE TRUEstr_ends(fruit, "e", negate = TRUE)#> [1] FALSE TRUE TRUE FALSE