AtLeast - Kalkwst/Risotto GitHub Wiki
Checks whether or not the number of elements in the sequence is greater than or equal to the given threshold.
In this page
Overload | Description |
---|---|
AtLeast(int threshold) | Determines whether the number of elements in the sequence is equal to or exceeds the provided threshold. |
Determines whether the number of elements in the sequence is equal to or exceeds the provided threshold.
public static bool AtLeast<TSource>(this IEnumerable<TSource> source, int threshold);
TSource
The type of the elements of source
.
source
IEnumerable <TSource>
A sequence that contains elements to be counted.
threshold
The minimum number of elements, the sequence must have.
true
the elements in the array are more than or equal to the threshold; false
otherwise.
source
is null
threshold
is negative.
The following code example demonstrates how to use AtLeast() to determine whether the element are at least equal to a given treshold.
int[] enoughElements = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
enoughElements.AtLeast(8);
//=> true
int[] notEnoughElements = new int[]{1, 2, 3};
notUniqueSource.AtLeast(5);
//=> false