Learn R Programming

icd (version 2.2)

trim: Trim leading and trailing white space

Description

NA is accepted and returned, probably as NA_character_

Usage

trim(x)

Arguments

x

character vector

Value

character vector

Examples

Run this code
# NOT RUN {
s <- random_string(250);
microbenchmark::microbenchmark(trim(s), trimws(s)) # trimws from R version 3.2
# }

Run the code above in your browser using DataLab