Learn R Programming

backports (version 1.5.0)

trimws: Backport of trimws for R < 3.3.0

Description

See the original description in base::trimws.

Usage

trimws(x, which = c("both", "left", "right"))

Arguments

Examples

Run this code
# get function from namespace instead of possibly getting
# implementation shipped with recent R versions:
bp_trimws = getFromNamespace("trimws", "backports")
bp_trimws(c("  a  ", "b  ", "  c"))

bp_trimws(c("  a  ", "b  ", "  c"), which = "left")

Run the code above in your browser using DataLab