R/trimws.R

Defines functions trimws

trimws <- function(x,left=TRUE,right=TRUE){
  res <- x
  if(left)
    res <- sub('^[ \t\r\n]+', '',res)
  if(right)
    res <- sub('[ \t\r\n]+$', '',res)
  res
}

Try the memisc package in your browser

Any scripts or data that you put into this service are public.

memisc documentation built on March 31, 2023, 7:29 p.m.