str_locate | R Documentation |
Locate patterns within a string
str_locate(string, pattern)
str_locate_all(string, pattern)
string |
Character vector of strings. |
pattern |
A pattern to match. Can be:
Unlike stringr, |
For str_locate()
, an integer matrix with one row for each element of
string
, and two columns ("start" and "end"). If the match is of length 0,
end will be one character less than start.
For str_locate_all()
, a list with one element for each element of string
.
Each list element is integer matrix with one row for each matche, and two
columns ("start" and "end").
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.