trim | R Documentation |
Trim leading or trailing whitespaces
trim(x, lead = TRUE, trail = TRUE)
x |
a character vector |
lead |
a boolean. If |
trail |
a boolean. If |
a character vector
Jakob Gepp
Since R 3.5.1 there is trimws
in the base
package.
x <- c(" Hello world!", " Hello world! ", "Hello world! ")
trim(x)
# [1] "Hello world!" "Hello world!" "Hello world!"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.