rtrim: Trim a string from the right

Description Usage Arguments Examples

View source: R/utils.R

Description

Trim a string from the right

Usage

1
rtrim(xs, nchars)

Arguments

xs

a string or character vector

nchars

the number of characters to remove (must be non-negative)

Examples

1
2
3
4
5
6
7
rtrim("hello", 2) == "hel"

rtrim("hello", 10) == ""

rtrim("hello", 0) == "hello"

rtrim(c("hello", "bye"), 1) == c("hell", "by")

knifecake/forrelgui documentation built on March 30, 2021, 10:26 p.m.