Skip to content

Add Iterable.takeUntil() or similar #739

@jvasileff

Description

@jvasileff

The method:

{Element*} takeUntil(Boolean stopping(Element element))

would be similar to takeWhile, with the following differences:

  • The passed in function would return true to signal the end of the stream, rather than false
  • The element that caused the "stop" would be included in the resultant stream (takeWhile discards the "final" element).

This is useful if your goal is to take all elements up to and including the "element you are looking for". found could also be used as the name for the passed in function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions