Bash - Trim string of white spaces
A Bash One-liner Function: Trim White Spaces
gsub - global sub, instead of sub that does 1st only
gsub man page
trim <- function(s) gsub("^[[:space:]]+|[[:space:]]+$","",s)
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.