R/Trim.R

#' Remove Leading/Trailing White Space
#' 
#' Remove leading/trailing white space.
#' 
#' @param x The text variable.  
#' @return Returns a vector with the leading/trailing white spaces removed.
#' @export
#' @examples
#' \dontrun{
#' (x <- c("  talkstats.com ", "   really? ", " yeah"))
#' Trim(x)
#' }
Trim <-
function (x) gsub("^\\s+|\\s+$", "", x)
trinker/qdap documentation built on Sept. 30, 2020, 6:28 p.m.