strs_removeprefix {strs} | R Documentation |
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)
Arguments
string |
A character vector where each element is a string from which to remove the prefix. |
prefix |
The prefix to remove. |
Value
A character vector of the same length as string
, with the prefix
removed from each element.
See Also
Python str.removeprefix() documentation
Examples
strs_removeprefix("testString", "test")
strs_removeprefix("hello world", "hello")
[Package strs version 0.1.0 Index]