Add, remove, or extract file extensions from character vectors
Source:R/str_fileext.R
str_fileext.RdThese function uses stringstatic::str_c(), stringstatic::str_remove() and
stringstatic::str_extract() and works to:
Add file extensions (or replace existing file extensions) with
str_add_fileext()Remove file extensions with
str_remove_fileext()Extract existing file names
str_extract_fileext()(returning NA values if a string has no file extension)
Usage
str_add_fileext(string, fileext = NULL)
str_remove_fileext(string, fileext = NULL)
str_extract_fileext(string, fileext = NULL)Arguments
- string
Character vector of any length. Required.
- fileext
File extension. Optional. Defaults to
NULL.