strs_contains checks whether each element of a character vector contains aspecified substring. This function mirrors the functionality of Python'sstr.__contains__() method.
Value
A logical vector of the same length asstring, with each elementindicating whether the corresponding element ofstring containssubstring.
Examples
strs_contains("hello world","world")#> [1] TRUEstrs_contains(c("apple","banana","cherry"),"a")#> [1] TRUE TRUE FALSE