grapes-contains-grapes: check whether a character string contains another

Description Usage Arguments Examples

Description

Just a simple shorthand so that inexperienced R users don't have to use somewhat complex functions such as grepl() and stringr::str_detect() with non-default arguments (e.g. fixed params).

Usage

1
haystack %contains% needle

Arguments

haystack

string in which you search

needle

string to search for

Examples

1
2
3
"1, 2, 3, 4, you" %contains% "you"
"1, 2, 3, 4, you" %contains% 1 # unlike str_detect casts all needles as characters
"1, 2, 3, 4, you" %contains% 343

grebbel/formr_test documentation built on May 17, 2019, 8:34 a.m.