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

Missing documentation for String::split #58181

Closed
terhechte opened this issue Feb 5, 2019 · 2 comments
Closed

Missing documentation for String::split #58181

terhechte opened this issue Feb 5, 2019 · 2 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@terhechte
Copy link
Contributor

split has the following to say regarding the types that the parameter Pattern can have:

The pattern can be a &str, [char], or a closure that determines the split.

However, another, undocumented, option is that the pattern can also be [&str] and then each split uses the next item from the slice. This is an awesome feature that is kinda difficult to figure out.

For reference:
https://news.ycombinator.com/item?id=19080404

@jonas-schievink jonas-schievink added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools labels Feb 5, 2019
@memoryruins
Copy link
Contributor

Thanks for reporting! A PR is currently open in #58172

@terhechte
Copy link
Contributor Author

ah thanks, hadn't seen that. will close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

3 participants