substring search r code example
Example 1: checking if a substring exists in a string r
grepl(regex, string_to_search)
Example 2: if string in r
grepl(value, chars, fixed = TRUE)
# TRUE
grepl(regex, string_to_search)
grepl(value, chars, fixed = TRUE)
# TRUE