has_ext: check for if the passed name has a file extension

View source: R/has_ext.R

has_extR Documentation

check for if the passed name has a file extension

Description

check for if the passed name has a file extension

Usage

has_ext(name, ext, match_case = TRUE)

Arguments

name

string name to check for extension

ext

string of extension to check

match_case

logical whether to match the case when checking extension. defaults to TRUE

Details

This is not a particularly robust checker, but serves its purpose

Examples

has_ext("test.rmd", ".rmd") #TRUE
has_ext("test.Rmd", ".rmd", match_case=FALSE) #TRUE
has_ext("testrmd", ".rmd") #FALSE

metrumresearchgroup/PKPDmisc documentation built on Oct. 21, 2022, 9:41 a.m.