Learn R Programming

PTXQC (version 1.0.14)

removeSuffix: 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)

Value

The input with removed suffix

Arguments

filepath

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

Examples

Run this code
 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'

Run the code above in your browser using DataLab