indexOf | R Documentation |
Returns a vector of the indices where a string occurs in another string
indexOf(a, b, ignore.case = FALSE)
a |
string to be checked against |
b |
string to check |
ignore.case |
logical; if |
If b
is longer than a
, indexOf
returns NA
, since
it is not possible for a longer string to occur in a shorter string.
Indices where b
occurs in a
. Returns NA
if there
are no occurences.
Samuel Leung
stringr::str_locate_all()
indexOf("derek", "e")
indexOf("Animals", "a")
indexOf("Animals", "A")
indexOf("Animals", "a", ignore.case = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.