R/trim.r

#' Function trim
#' 
#' Trims elements of a character vector.
#' @param x A character vector.
#' @details Trims elements of a character vector.
#' @keywords preprocessing
#' @export
#' @examples
#' trim(" Hi  ")

trim <- function (x) 
gsub("(^[ \n\r\t]+|[ \n\r\t]+$)", "", x)
AndreasFischer1985/quantqual documentation built on June 20, 2022, 4:55 p.m.