str_starts(string, pattern, negate = FALSE) str_ends(string, pattern, negate = FALSE)
Input vector. Either a character vector, or something coercible to one.
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
A logical vector.
str_detect() which this function wraps when pattern is regex.
fruit <- c("apple", "banana", "pear", "pinapple") str_starts(fruit, "p") str_starts(fruit, "p", negate = TRUE) str_ends(fruit, "e") str_ends(fruit, "e", negate = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.