EnumerableExtensions Class

Provides extension methods for the IEnumerableT type.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
C#
public static class EnumerableExtensions
Inheritance
Object    EnumerableExtensions

Methods

ForEachT Similarly to the List<T>.ForEach method, processes an action on each element of an enumerable collection.
GetRandomElementT(IEnumerableT, Boolean) Gets a random element from the enumerable source using a new FastRandom instance.
GetRandomElementT(IEnumerableT, Random, Boolean) Gets a random element from the enumerable source using a specified Random instance.
IndexOf(IEnumerable, FuncObject, Boolean) Searches for an element in the source enumeration where the specified predicate returns .
IndexOf(IEnumerable, Object) Searches for an element in the source enumeration.
IndexOfT(IEnumerableT, T) Searches for an element in the source enumeration.
IndexOfT(IEnumerableT, FuncT, Boolean) Searches for an element in the source enumeration where the specified predicate returns .
IsNullOrEmpty(IEnumerable) Determines whether the specified source is or empty (has no elements).
IsNullOrEmptyT(IEnumerableT) Determines whether the specified source is or empty (has no elements).
JoinT(IEnumerableT, Char) Concatenates the items of the source collection into a new string instance using the specified separator between the items.
JoinT(IEnumerableT, String) Concatenates the items of the source collection into a new string instance using the specified separator between the items.
ShuffleT(IEnumerableT) Shuffles an enumerable source (randomizes its elements) using a new FastRandom instance.
ShuffleT(IEnumerableT, Guid) Shuffles an enumerable source (randomizes its elements) using the provided seed with a new FastRandom instance.
ShuffleT(IEnumerableT, Int32) Shuffles an enumerable source (randomizes its elements) using the provided seed with a new FastRandom instance.
ShuffleT(IEnumerableT, Random) Shuffles an enumerable source (randomizes its elements) using a specified Random instance.
ToCircularListT Creates a CircularListT from an IEnumerableT.
ToStringKeyedDictionaryTValue(IEnumerableTValue, FuncTValue, String, StringSegmentComparer) Creates a StringKeyedDictionaryTValue from an IEnumerableT instance using the specified keySelector delegate and a comparer.
ToStringKeyedDictionaryTSource, TValue(IEnumerableTSource, FuncTSource, String, FuncTSource, TValue, StringSegmentComparer) Creates a StringKeyedDictionaryTValue from an IEnumerableT instance using the specified key and value selector delegates and a comparer.
TryAdd(IEnumerable, Object, Boolean, Boolean) Tries to add the specified item to the collection.
TryAddT(IEnumerableT, T, Boolean, Boolean) Tries to add the specified item to the collection.
TryAddRange(IEnumerable, IEnumerable, Boolean, Boolean) Tries to add the specified collection to the target collection.
TryAddRangeT(IEnumerableT, IEnumerableT, Boolean, Boolean) Tries to add the specified collection to the target collection.
TryClear(IEnumerable, Boolean, Boolean) Tries to remove all elements from the collection.
TryClearT(IEnumerableT, Boolean, Boolean) Tries to remove all elements from the collection.
TryGetCount(IEnumerable, Int32) Tries to get the number of elements in the source enumeration without enumerating it.
TryGetCountT(IEnumerableT, Int32) Tries to get the number of elements in the source enumeration without enumerating it.
TryGetElementAt(IEnumerable, Int32, Object, Boolean, Boolean) Tries to get an item at the specified index in the collection.
TryGetElementAtT(IEnumerableT, Int32, T, Boolean, Boolean) Tries to get an item at the specified index in the collection.
TryInsert(IEnumerable, Int32, Object, Boolean, Boolean) Tries to insert the specified item at the specified index to the collection.
TryInsertT(IEnumerableT, Int32, T, Boolean, Boolean) Tries to insert the specified item at the specified index to the collection.
TryInsertRange(IEnumerable, Int32, IEnumerable, Boolean, Boolean) Tries to insert the specified collection into the target collection.
TryInsertRangeT(IEnumerableT, Int32, IEnumerableT, Boolean, Boolean) Tries to insert the specified collection into the target collection.
TryRemove(IEnumerable, Object, Boolean, Boolean) Tries to remove the specified item from to the collection.
TryRemoveT(IEnumerableT, T, Boolean, Boolean) Tries to remove the specified item from to the collection.
TryRemoveAt(IEnumerable, Int32, Boolean, Boolean) Tries to remove an item at the specified index from the collection.
TryRemoveAtT(IEnumerableT, Int32, Boolean, Boolean) Tries to remove an item at the specified index from the collection.
TryRemoveRange(IEnumerable, Int32, Int32, Boolean, Boolean) Tries to remove count amount of items from the specified collection at the specified index.
TryRemoveRangeT(IEnumerableT, Int32, Int32, Boolean, Boolean) Tries to remove count amount of items from the specified collection at the specified index.
TryReplaceRange(IEnumerable, Int32, Int32, IEnumerable, Boolean, Boolean) Tries to remove count amount of items from the target at the specified index, and to insert the specified collection at the same position. The number of elements in collection can be different from the amount of removed items.
TryReplaceRangeT(IEnumerableT, Int32, Int32, IEnumerableT, Boolean, Boolean) Tries to remove count amount of items from the target at the specified index, and to insert the specified collection at the same position. The number of elements in collection can be different from the amount of removed items.
TrySetElementAt(IEnumerable, Int32, Object, Boolean, Boolean) Tries to set the specified item at the specified index in the collection.
TrySetElementAtT(IEnumerableT, Int32, T, Boolean, Boolean) Tries to set the specified item at the specified index in the collection.

See Also