trim: Trim leading and tailing spaces from string

Description Usage Arguments Details Value Author(s) Examples

View source: R/trim.R

Description

The function trims leading and/or tailing spaces from string(s), using C function implemented in the BIOS library.

Usage

1
trim(x, left = " \n\r\t", right = " \n\r\t")

Arguments

x

A character string, or a vector of strings

left

Characters that are trimmed from the left side.

right

Characters that are trimmed from the right side

Details

left and right can be set to NULL. In such cases no trimming will be performed.

Value

Trimmed string(s)

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

Examples

1
2
3
4
myStrings <- c("This is a fine day\n",
               " Hallo Professor!",
               "  NUR DER HSV  ")
trim(myStrings)

ribiosUtils documentation built on March 13, 2020, 2:54 a.m.