R/rstrip.R
strs_rstrip.Rd
strs_rstrip removes trailing characters (spaces by default) from eachelement of a character vector. It is similar to Python'sstr.rstrip()method.
strs_rstrip
str.rstrip()
strs_rstrip(string, chars=NULL)
A character vector where each element is a string to beright-stripped.
An optional string of characters to be removed from the end ofeach element. If NULL, whitespace is removed.
A character vector of the same length asstring, with specifiedcharacters removed from the end of each element.
string
Python str.rstrip() documentation
strs_rstrip("hello world ")#> [1] "hello world"strs_rstrip("hello worldxxx", chars="x")#> [1] "hello world"