R: Extract filenames from a URLs

url_filename {xfun} | R Documentation

## Extract filenames from a URLs

### Description

Get the base names of URLs via `basename()`, and remove the possible query parameters or hash from the names.

### Usage

    url_filename(x)

### Arguments

`x` | A character vector of URLs.

### Value

A character vector of filenames at the end of URLs.

### Examples

    xfun::url_filename("https://yihui.org/images/logo.png")
    xfun::url_filename("https://yihui.org/index.html")
    xfun::url_filename("https://yihui.org/index.html?foo=bar")
    xfun::url_filename("https://yihui.org/index.html#about")

[Package xfun version 0.20 Index]