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
#' (x <- c("  talkstats.com ", "   really? ", " yeah"))
#' Trim(x)
Trim <-
function (x) gsub("^\\s+|\\s+$", "", x)
trinker/qdap2 documentation built on May 31, 2019, 9:47 p.m.