str_detect {stringr} | R Documentation |
Detect the presence or absence of a pattern in a string.
str_detect(string, pattern)
string |
input character vector |
pattern |
pattern to look for. See regex for
description. |
boolean vector
grepl
which this function wraps
fruit <- c("apple", "banana", "pear", "pinapple") str_detect(fruit, "a") str_detect(fruit, "^a") str_detect(fruit, "a$") str_detect(fruit, "b") str_detect(fruit, "[aeiou]")