powered by
string
pattern
str_locate_all(string, pattern)
regex
fixed
$
regexpr
str_extract for a convenient way of extracting matches
str_extract
str_locate to locate position of first match
str_locate
fruit <- c("apple", "banana", "pear", "pineapple") str_locate_all(fruit, "a") str_locate_all(fruit, "e") str_locate_all(fruit, c("a", "b", "p", "p"))
Run the code above in your browser using DataLab