R/trim.R

Defines functions trim

Documented in trim

#' trim
#'
#' Trims leading and trailing whitespace
#'
#' @param x is a character vector
#'
#' @return a character vector with leading and trailing spaces removed
#'
#' @examples
#' trim(" foo ")
#'
#' @export

trim <- function(x) {gsub("^\\s+|\\s+$", "", x)}
familyforestresearchcenter/nwos documentation built on April 12, 2025, 11:54 a.m.