strs_startswith | R Documentation |
strs_startswith
determines whether each element of a character vector
starts with a specified prefix. It is similar to Python's str.startswith()
method.
strs_startswith(string, prefix)
string |
A character vector where each element is a string to be checked. |
prefix |
The prefix to check for at the start of each element of
|
A logical vector of the same length as string
, with each element
indicating whether the corresponding element of string
starts with
prefix
.
Python str.startswith() documentation
strs_startswith("hello world", "hello")
strs_startswith(c("test", "hello", "world"), "te")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.