Skip to content

Missing documentation for String::split #58181

Closed
@terhechte

Description

@terhechte

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions