Learn R Programming

stringfish (version 0.16.0)

sf_starts: sf_starts

Description

A function for detecting a pattern at the start of a string

Usage

sf_starts(subject, pattern, ...)

Value

A logical vector true if there is a match, false if no match, NA is the subject was NA

Arguments

subject

A character vector

pattern

A string to look for at the start

...

Parameters passed to sf_grepl

See Also

startsWith, sf_ends

Examples

Run this code
if(getRversion() >= "3.5.0") {
x <- c("alpha", "beta", "gamma", "delta", "epsilon")
sf_starts(x, "a")
}

Run the code above in your browser using DataLab