rmv.spc: Remove leading and trailing spaces (or other character).

View source: R/NCmisc.R

rmv.spcR Documentation

Remove leading and trailing spaces (or other character).

Description

Remove leading and trailing spaces (or other character).

Usage

rmv.spc(str, before = TRUE, after = TRUE, char = " ")

Arguments

str

character vector, may containing leading or trailing chars

before

logical, whether to remove leading spaces

after

logical, whether to remove trailing spaces

char

an alternative character to be removed instead of spaces

Value

returns vectors without the leading/trailing characters

Author(s)

Nicholas Cooper njcooper@gmx.co.uk

See Also

spc

Examples

rmv.spc("  mid sentence  ")
rmv.spc("0012300",after=FALSE,char="0")
rmv.spc(" change nothing ",after=FALSE,before=FALSE)

NCmisc documentation built on Oct. 17, 2022, 5:09 p.m.