-
Notifications
You must be signed in to change notification settings - Fork 40
Closed
Labels
Description
/// <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);