The function trims leading and/or tailing spaces from string(s), using C function implemented in the BIOS library.
trim(x, left = " \n\r\t", right = " \n\r\t")
A character string, or a vector of strings
Characters that are trimmed from the left side.
Characters that are trimmed from the right side
Trimmed string(s)
left
and right
can be set to NULL. In such cases no trimming
will be performed.
myStrings <- c("This is a fine day\n",
" Hallo Professor!",
" NUR DER HSV ")
trim(myStrings)
#> [1] "This is a fine day" "Hallo Professor!" "NUR DER HSV"