rm_spaces: Remove spaces from a character vector

View source: R/char_utils.R

rm_spacesR Documentation

Remove spaces from a character vector

Description

This function removes spaces (all leading and trailing ones, and unique in-between) from a character vector.

Usage

rm_spaces(string, all = FALSE)

Arguments

string

a character vector

all

logical, if TRUE remove all blank spaces, otherwise rm only duplicated and leading/trailing ones.

Examples

test <- c("  test ", "  mediterranean  sea  ")
rm_spaces(test)

lbraglia/lbmisc documentation built on April 29, 2024, 11:27 a.m.