Movatterモバイル変換


[0]ホーム

URL:


Skip to contents

Right strip characters from a string

Source: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.

Usage

strs_rstrip(string, chars=NULL)

Arguments

string

A character vector where each element is a string to beright-stripped.

chars

An optional string of characters to be removed from the end ofeach element. If NULL, whitespace is removed.

Value

A character vector of the same length asstring, with specifiedcharacters removed from the end of each element.

See also

Python str.rstrip() documentation

Examples

strs_rstrip("hello world    ")#> [1] "hello world"strs_rstrip("hello worldxxx", chars="x")#> [1] "hello world"

[8]ページ先頭

©2009-2025 Movatter.jp