IndexOf<>(source, predicate, startIndex) IndexOf<>(source, element, comparer) JoinString<>(values, separator, prefix, suffix, lastSeparator) Order<>(source, comparer) SkipLast<>(source, count, throwIfNotEnough) Split<>(splitWhat, splitWhere) Split<>(source, chunkSize) ToDictionary2<>(source, key1Selector, key2Selector, comparer1, comparer2) ToDictionary2<>(source, key1Selector, key2Selector, elementSelector, comparer1, comparer2)
Legend Class Struct Enum Interface Delegate | Constructor Method Property Event Field |
| Extension method: IEnumerable<T> InsertBetween<T>(this IEnumerable<T>, T)Declarationpublic static IEnumerable<T> InsertBetween<T>(
this IEnumerable<T> source,
T extraElement
) Summary
Inserts the specified item in between each element in the input collection. Generic type parametersT | This type parameter is not documented. |
Parametersthis IEnumerable<T> | source |
The input collection. | T | extraElement |
The element to insert between each consecutive pair of elements in the input collection. |
Returns
A collection containing the original collection with the extra element inserted. For example, new[] { 1, 2, 3
}.InsertBetween(0) returns { 1, 0, 2, 0, 3 }. |