fileExtension: Get Extension of Full File Paths

View source: R/string.R

fileExtensionR Documentation

Get Extension of Full File Paths

Description

Get Extension of Full File Paths

Usage

fileExtension(x)

Arguments

x

vector of file paths

Examples

# Define example paths
paths <- c("C:/example/file.csv", "file2.txt", "D:/e/f/ghi.jkl.zip")

# Get the file name extensions
fileExtension(paths)

# Empty string is returned for paths without file name extensions
fileExtension("C:/NEWS")

KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.