trimws: Backport of trimws for R < 3.3.0

View source: R/trimws.R

trimwsR Documentation

Backport of trimws for R < 3.3.0

Description

See the original description in base::trimws.

Usage

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

Examples

# 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")

mllg/backports documentation built on March 15, 2023, 8:07 p.m.