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

Description Usage Arguments Value Examples

View source: R/fcn_misc.R

Description

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

Usage

1
removeSuffix(filepath)

Arguments

filepath

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

Value

The input with removed suffix

Examples

1
2
3
4
 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 Oct. 4, 2021, 9:08 a.m.