Detect the presence or absence of a pattern at the beginning or end of a string or string vector.

str_starts(string, pattern, negate = FALSE)

str_ends(string, pattern, negate = FALSE)

Arguments

string

input string

pattern

pattern with which the string starts or ends

negate

if TRUE, return non-matching elements

Value

a logical vector

Author

Guangchuang Yu