%begins_with% | R Documentation |
Escapes any special RegExp characters in the search term. A way to check whether the search term
(e.g. a variable name) is the beginning.
Just a simple shorthand so that inexperienced R users won't have to use somewhat complex functions such as grepl()
and stringr::str_detect()
.
You can also use \%starts_with\%.
haystack %begins_with% needle
haystack |
string in which you search |
needle |
string to search for |
"1, 3, 4" %begins_with% "1" # TRUE
"1, 3, 4" %begins_with% 1 # unlike str_detect casts all needles as characters
"1, 3, 4" %begins_with% "." # FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.