rtrim: Trim a string from the right

Description Usage Arguments Examples

View source: R/references.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/forrelshiny documentation built on March 15, 2020, 12:36 p.m.