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

View source: R/misc.R

removeFileSuffixR 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

removeFileSuffix(filepath)

Arguments

filepath

A filename (with optional path – which is retained)

Value

The input with removed suffix

Examples

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


rmzqc documentation built on May 29, 2024, 12:06 p.m.