removeSuffix: Removes the last suffix (including the last dot) from a...

View source: R/fcn_misc.R

removeSuffixR Documentation

Removes the last suffix (including the last dot) from a filename. If no dot exists, the full string is returned.

Description

Removes the last suffix (including the last dot) from a filename. If no dot exists, the full string is returned.

Usage

removeSuffix(filepath)

Arguments

filepath

A filename (with optional path – which is retained!)

Value

The input with removed suffix

Examples

 removeSuffix("test.tar.gz")  # --> 'test.tar'
 removeSuffix("test.mzML")  # --> 'test'
 removeSuffix("/path/to/test.mzML")  # --> '/path/to/test'
 removeSuffix("test_no_dot")  # --> 'test_no_dot'


PTXQC documentation built on Sept. 21, 2022, 9:10 a.m.