Provides methods for manipulating IEnumerable collections.
public static class EnumerableUtility
name | description |
---|---|
static AreEqual<T>(…) | Returns a value indicating whether the specified sequences are equal. Supports one or both sequences being null. (3 methods) |
static AsReadOnlyList<T>(…) | Represents the sequence as an IReadOnlyList. |
static AsSet<T>(…) | Returns a set of the elements in the specified sequence. |
static CountIsAtLeast<T>(…) | Returns true if the count is greater than or equal to the specified value. |
static CountIsExactly<T>(…) | Returns true if the count is as specified. |
static CrossProduct<T>(…) | Returns the Cartesian cross-product of a sequence of sequences. |
static CrossProduct<TSequence,TItem>(…) | Returns the Cartesian cross-product of a sequence of sequences. |
static Except<T>(…) | Makes distinct and then removes a single item from a sequence. (2 methods) |
static GroupConsecutiveBy<TSource,TKey>(…) | Groups the elements of a sequence according to a specified key selector function. Each group consists of consecutive items having the same key. Order is preserved. |
static Intersperse<T>(…) | Intersperses the specified value between the elements of the source collection. |
static IsSorted<T>(…) | Determines whether the specified sequence is sorted. (2 methods) |
static MergeSorted<T>(…) | Lazily merges two sorted sequences, maintaining sort order. Does not remove duplicates. |
static NullableSum(…) | Returns the sum of a sequence of nullable values. (2 methods) |
static Order<T>(…) | Sorts the sequence. A shortcut for OrderBy(x => x). (2 methods) |
static SequenceCompare<T>(…) | Compares two sequences. (2 methods) |
static SequenceHashCode<T>(…) | Gets the hash code for a sequence. (2 methods) |
static SplitIntoBins<T>(…) | Splits the source sequence into binCount equal-sized bins. If binCount does not evenly divide the total element count, then the first (total count % binCount) bins will have one more element than the following bins. |
static TryFirst<T>(…) | Returns true if the sequence is not empty and provides the first element. (2 methods) |
static WhereNotNull<T>(…) | Enumerates the specified collection, returning all the elements that are not null. (2 methods) |
static Zip<T1,T2>(…) | Combines two same sized sequences. |
static ZipTruncate<T1,T2>(…) | Combines two sequences. |