Skip to content

EnumerableExtensions Class ​

Definition ​

Extensions for Enumerable objects

  • Namespace: JASE.Extensions
  • Assembly: JASE.Primitives.dll

Methods ​

NameDescription
ICollection<T> AddUniqueRange(ICollection<T> input, IEnumerable<T> range, bool sorted = null)Adds the Distinct objects in range to the current list
bool Compare(IEnumerable<T> input, IEnumerable<T> to, bool sortFirst = null, IComparer<T> compareter = null, IEqualityComparer<T> equalityComparer = null)Compare the elements of two IEnumerables
List<T> Differences(IEnumerable<T> source, IEnumerable<T> compareTo)Returns a List of items contained in the source list that are missing from the compareTo list
void ForEach(IEnumerable<T> enumerable, Action<T> action)Provide ForEach support for generic constrained IEnumerable
Type GetEnumeratedType(IEnumerable<T> _)Get the data type contained in the IEnumerable
IEnumerable<T> PickRandom(IEnumerable<T> source, int count)Returns a randomly selected list item from the source
List<T> PickRandom(IList<T> source, int count, bool remove = null)Returns a randomly selected list item from the source
T PickRandom(IEnumerable<T> source)Returns a randomly selected item from the source
T PickRandom(IList<T> source, bool remove = null)Returns a randomly selected item from the source
T Random(IEnumerable<T> source)Alias for PickRandom
IEnumerable<T> Randomize(IEnumerable<T> source)Randomly orders the items within source
List<T> RotateLeft(IEnumerable<T> list, int count)Returns List of items rotated to the Left by count
List<T> RotateRight(IEnumerable<T> list, int count)Returns List of items rotated to the Right by count
bool Search(IEnumerable<string> list, string search)Search an Enumerable list of strings for a patten match
bool Search(IEnumerable<string> list, string search, bool caseInsensitive)Search an Enumerable list of strings for a patten match
List<T> TakeAndRemove(IList<T> source, int count)Returns List of items from source. The returned items are removed from the source IList