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

backports documentation built on June 24, 2024, 5:24 p.m.