Skip to content

splitn documentation is not clear #36202

Closed
@durka

Description

@durka

An iterator over substrings of the given string slice, separated by a pattern, restricted to returning at most count items.

The last element returned, if any, will contain the remainder of the string slice.

Is the last element yielded by the iterator the remainder after the N items, or is the remainder included in N? The answer is the latter, but I don't think it's clear. Or am I the problem here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions