trim: Remove leading and trailing whitespace from characters

View source: R/all.R

trimR Documentation

Remove leading and trailing whitespace from characters

Description

Inspired by the Excel function with the same name.

Usage

trim(x)

Arguments

x

a vector of strings

Value

x without any leading or trailing whitespace.

Examples

trim('  leading spaces')
trim('trailing spaces   ')
trim('  leading and trailing spaces   ')
trim('\n\r\t Other kinds of whitespace \t\n\r')
trim("\n Doesn't affect internal whitespace  ")


adamleerich/alrtools documentation built on March 12, 2024, 11:38 p.m.