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 Aug. 12, 2024, 12:31 p.m.