Description Usage Arguments Value Examples
check if a character string x is contained within another character string y. If the 'start' condition is set, only check if y starts with x (i.e. for partial match evaluations). The %substr% operator works equivalently, returning true if the lhs is a substring of the rhs.
1 2 3 | is.substring(x, y, start = FALSE)
lhs %substr% rhs
|
x |
character - a single character string |
y |
character - a single character string that may contain x |
start |
logical - if TRUE only check the first subsequence of y for x |
logical - whether x is a substring of y
1 2 3 4 5 | is.substring('abc', 'abcdef', start = TRUE) # TRUE
is.substring(' abc', 'abcdef', start = TRUE) # FALSE
is.substring('xyz', 'abcdef') # FALSE
is.substring('xyz','uvwxyz') # TRUE
'abc' %substr% '_abcdef_' # TRUE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.