Learn R Programming

bazar (version 1.0.11)

trim: Removes extra whitespaces from a string

Description

The function trim removes unnecessary whitespaces from a character vector.

Usage

trim(x)

Arguments

x

character. The character vector at stake.

Value

A character vector of the same length as x.

See Also

gsub.

Examples

Run this code
# NOT RUN {
trim(c(" a b", "Hello  World "))

# }

Run the code above in your browser using DataLab