powered by
trimws
trimws(x,left=TRUE,right=TRUE)
TRUE
x
teststr <- c("Hello World! ","I am here. ") trimws(teststr) trimws(teststr,left=FALSE) trimws(teststr,right=FALSE)
Run the code above in your browser using DataLab