strs_removesuffix {strs}R Documentation

Remove a suffix from a string

Description

strs_removesuffix removes a specified suffix from the end of each element of a character vector. It is similar to Python's str.removesuffix() method.

Usage

strs_removesuffix(string, suffix)

Arguments

string

A character vector where each element is a string from which to remove the suffix.

suffix

The suffix to remove.

Value

A character vector of the same length as string, with the suffix removed from each element.

See Also

Python str.removesuffix() documentation

Examples

strs_removesuffix("StringTest", "Test")
strs_removesuffix("hello world", "world")

[Package strs version 0.1.0 Index]