strip_extension: Strip one or more extensions off one or more filenames

View source: R/file.R

strip_extensionR Documentation

Strip one or more extensions off one or more filenames

Description

Greedy behavior is optional. Given filename /B/b/B.csv.txt greedy behavior yields /B/b/B while lazy behavior yields /B/b/B.csv

Usage

strip_extension(x = c("/A/A.txt", "/B/b/B.csv.txt", "/C/c.C/C.foo"),
  greedy = FALSE)

Arguments

x

character vector of one or more filenames

greedy

logical if TRUE remove all extensions

Value

filenames without extensions

See Also

https://stackoverflow.com/questions/2301285/what-do-lazy-and-greedy-mean-in-the-context-of-regular-expressions


BigelowLab/rscripting documentation built on Oct. 24, 2022, 5:31 p.m.