Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trailing and leading blanks for oins and pins #108

Open
MansMeg opened this issue May 6, 2016 · 2 comments
Open

Remove trailing and leading blanks for oins and pins #108

MansMeg opened this issue May 6, 2016 · 2 comments
Milestone

Comments

@MansMeg
Copy link
Contributor

MansMeg commented May 6, 2016

Now leading and trailing blanks are not removed. See:

# returns string w/o leading whitespace
trim.leading <- function (x)  sub("^\\s+", "", x)

# returns string w/o trailing whitespace
trim.trailing <- function (x) sub("\\s+$", "", x)

# returns string w/o leading or trailing whitespace
trim <- function (x) gsub("^\\s+|\\s+$", "", x)
@eribul
Copy link
Contributor

eribul commented Dec 14, 2018

There is also a function base::trimws already available in R :-)

@MansMeg
Copy link
Contributor Author

MansMeg commented Dec 14, 2018

That's great!
Maybe we should try to remove the stringr package from dependencies in the long run. And maybe even move lubridate to suggested (and import when used).

@MansMeg MansMeg added this to the Version 1.5 milestone Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants