Skip to contents

Match strings for the prefixes using base::startsWith(). Return a logical vector that indicate all matches.

Usage

startsWith_multiple(strings, prefixes)

Arguments

strings

character vector to match

prefixes

character vector with prefixes

Value

A logical vector with the same length as `strings`

Examples

x1 <- c("Foobar", "bla bla", "something", "another", "blu", "brown", "blau blüht der Enzian")
p <- c("Foo", "bl")
startsWith_multiple(x1, p)
#> [1]  TRUE  TRUE FALSE FALSE  TRUE FALSE  TRUE