str_before_last_dot: Extract the part of a string before the last period.

View source: R/before.R

str_before_last_dotR Documentation

Extract the part of a string before the last period.

Description

This is usually used to get the part of a file name that doesn't include the file extension. It is vectorized over string. If there is no period in string, the input is returned.

Usage

str_before_last_dot(string)

Arguments

string

A character vector.

Value

A character vector.

See Also

Other bisectors: before-and-after

Examples

str_before_last_dot(c("spreadsheet1.csv", "doc2.doc", ".R"))

strex documentation built on Nov. 2, 2023, 6:04 p.m.