IEnumerable extensions - siof/common.extensions GitHub Wiki

IEnumerable extensions

ToString

string ToString<T>(this IEnumerable<T> collection) string ToString<T>(this IEnumerable<T> collection, char separator) string ToString<T>(this IEnumerable<T> collection, string separator)

Uses StringBuilder to produce string. Each item is 'converted' to string using ToString() method with optional separator added after each element.

ForEach

void ForEach<T>(this IEnumerable<T> collection, Action<T> action)

Iterates through collection and invokes action on each element.

SplitToList

List<List<T>> SplitToList<T>(this IEnumerable<T> collection, uint chunkSize)

Splits collection to list of lists. Each list has size lower or equal to requested in second parameter.

⚠️ **GitHub.com Fallback** ⚠️