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

Add eachrsplit iterator #45385

Closed
jakobnissen opened this issue May 20, 2022 · 0 comments · Fixed by #51646
Closed

Add eachrsplit iterator #45385

jakobnissen opened this issue May 20, 2022 · 0 comments · Fixed by #51646

Comments

@jakobnissen
Copy link
Contributor

It would be natural and useful to have an eachrsplit iterator, which should be to rsplit what eachsplit is to split. I couldn't find an existing issue on this.

vtjnash pushed a commit that referenced this issue Oct 11, 2023
Unlike rsplit, this iterator returns split substrings right to left, but
other- wise it behaves just like eachsplit.
This design has been chosen to avoid either a costly double traversal of
the input string, or needing a stack to store the strings. Both of these
workarounds would lessen the appeal compared to simply using rsplit.

Closes #45385
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

Successfully merging a pull request may close this issue.

1 participant