Skip to contents

Based on the separating character, determine the file extension.

Usage

file_ext(path, sep_char = ".")

Arguments

path

character value of the file path possibly with an extension.

sep_char

character value of the separator that delineates the extension from the file path.
Generally, this will be .", but for some API URLs, the extension is actually a query component, so the separator may sometimes need to be "=".

Value

character value of the extension (file_ext).

Examples

   file_ext("home/folders.with.dots/stuff/ok.csv")
   file_ext(NMME_urls()[[1]])
   file_ext(NMME_urls()[[1]], "=")