Learn R Programming

strs (version 0.1.0)

strs_removeprefix: Remove a prefix from a string

Description

strs_removeprefix removes a specified prefix from the start of each element of a character vector. It is similar to Python's str.removeprefix() method.

Usage

strs_removeprefix(string, prefix)

Value

A character vector of the same length as string, with the prefix

removed from each element.

Arguments

string

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

prefix

The prefix to remove.

See Also

Examples

Run this code
strs_removeprefix("testString", "test")
strs_removeprefix("hello world", "hello")

Run the code above in your browser using DataLab