Description Usage Arguments Reuse good code Alternative
Trims leading and trailing blanks from a vector of character variables. Multibyte character strings are returned intact. (extended ascii in R appears as hex values).
1 | trim(s)
|
s |
Character vector. |
"The single biggest way to improve both the quality of your code and your productivity is to reuse good code (...) Many algorithms have already been invented, tested, discussed in the trade literature, reviewed, and improved".
–Code complete 2, by Steve McConnell.
A more powerful and general alternative is stringr::str_trim()
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.