Skip to content

Filter allows you to invert the result by a boolean #196

@ymh199478

Description

@ymh199478
/// <summary>
/// Passing each value in the specified iterator to the callback function, if the callback function matches the <see cref="expected" /> value, then adding the current value in the specified iterator to the result array.
/// </summary>
/// <typeparam name="T">The type of the array.</typeparam>
/// <param name="source">The iterator</param>
/// <param name="predicate">Add an element to the result array if it is equal to <see cref="expected" /></param>
/// <param name="expected">The expected value.</param>
/// <returns>The filtered array.</returns>
static T[] Filter<T>(T[] source, Predicate<T> predicate, bool expected = true);
static T[] Filter<T>(IEnumerable<T> source, Predicate<T> predicate, bool expected= true);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions