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

str_[starts|ends] #258

Closed
hammer opened this issue Sep 25, 2018 · 3 comments
Closed

str_[starts|ends] #258

hammer opened this issue Sep 25, 2018 · 3 comments

Comments

@hammer
Copy link

@hammer hammer commented Sep 25, 2018

Maybe not worth the API bloat, but I think regex-phobic users might like to have str_starts(string, prefix) as an alias for str_detect(string, "^prefix") and str_ends(string, suffix) as an alias for str_detect(string, "suffix$").

For some evidence of need, Does R have function startswith or endswith like python? has quite a few upvotes.

I know we have startsWith and endsWith in base R; I just prefer to stay in the tidyverse!

@gagolews
Copy link
Contributor

@gagolews gagolews commented Sep 29, 2018

note stringi has stri_endswith and stri_startswith

@hadley
Copy link
Member

@hadley hadley commented Jan 4, 2019

I like the idea, and implementation will be straightforwar

@jonthegeek
Copy link
Contributor

@jonthegeek jonthegeek commented Jan 19, 2019

Claiming this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants