removeTrail: Remove trailing white spaces

Description Usage Arguments Value Examples

Description

Remove trailing white spaces (or other character) from a string

Usage

1
removeTrail(str, before = TRUE, after = TRUE, char = " ")

Arguments

str

character string to be trimmed

before

a logical which indicates whether to remove the character from the beginning of the string

after

a logical which indicates whether to remove the character from the end of the string

char

the character to be removed

Value

Returns a string from which the character specified has been removed. If the argument char is not specified, then this will be trailing white spaces.

Examples

1
2
3
4
5
str <- "  this is a test   "
x <- removeTrail(str, before = TRUE)
x <- removeTrail(str, after = TRUE)
x <- removeTrail(str, before = TRUE, after = TRUE)
x <- removeTrail(str, before = TRUE, char = "  th")

anilchalisey/juggleR documentation built on May 9, 2019, 4 a.m.