Skip to contents

Does a String End with Slash?

Usage

hasFinalSlash(x)

Arguments

x

vector of character

Value

vector of boolean being TRUE at indices where the elements in

x end with a slash ("/")

Examples

(is_directory <- hasFinalSlash(c("a", "b/", "c", "d/")))
#> [1] FALSE  TRUE FALSE  TRUE