Skip to contents

Remove leading, trailing (and, if requested, duplicate) spaces

Usage

hsTrim(str, trim.multiple.spaces = TRUE, dbg = FALSE)

Arguments

str

vector of character containing the strings to be trimmed

trim.multiple.spaces

if TRUE (default), multiple consecutive spaces are replaced by one space

dbg

if TRUE (the default is FALSE) debut messages are shown

Value

input string str without leading or trailing spaces and with multiple consecutive spaces being replaced by a single space