extract_file_extension {urlexplorer} | R Documentation |
Extract file extension from URLs or paths
Description
This function parses each input URL or path and extracts the file extension, if present. It is particularly useful for identifying the type of files referenced in URLs.
Usage
extract_file_extension(url)
Arguments
url |
A character vector of URLs or paths from which to extract file extensions. |
Value
A character vector with the file extension for each URL or path.
Extensions are returned without the dot (e.g., "jpg" instead of ".jpg"),
and URLs or paths without extensions will return NA
.
Examples
extract_file_extension(
c(
"http://example.com/image.jpg",
"https://example.com/archive.zip",
"http://example.com/"
)
)
[Package urlexplorer version 0.1.0 Index]