% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/trim.R
\name{trim}
\alias{trim}
\title{Trim leading and trailing whitespaces from strings}
\usage{
trim(x)
}
\arguments{
\item{x}{Character vector or string, or a list or data frame with such vectors.
Function is vectorized, i.e. vector may have a length greater than
1. See 'Examples'.}
}
\value{
Trimmed \code{x}, i.e. with leading and trailing spaces removed.
}
\description{
Trims leading and trailing whitespaces from strings or
               character vectors.
}
\examples{
trim("white space at end ")
trim(" white space at start and end ")
trim(c(" string1 ", "   string2", "string 3   "))

tmp <- data.frame(a = c(" string1 ", "   string2", "string 3   "),
                  b = c(" strong one  ", "    string two", "  third string "),
                  c = c(" str1 ", "   str2", "str3   "))
tmp
trim(tmp)

}
