powered by
strs_rstrip removes trailing characters (spaces by default) from each element of a character vector. It is similar to Python's str.rstrip() method.
strs_rstrip
str.rstrip()
strs_rstrip(string, chars = NULL)
A character vector of the same length as string, with specified characters removed from the end of each element.
string
A character vector where each element is a string to be right-stripped.
An optional string of characters to be removed from the end of each element. If NULL, whitespace is removed.
Python str.rstrip() documentation
strs_rstrip("hello world ") strs_rstrip("hello worldxxx", chars = "x")
Run the code above in your browser using DataLab