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> InsertBetweenWithAnd<T>(this IEnumerable<T>, T, T)Declarationpublic static IEnumerable<T> InsertBetweenWithAnd<T>(
this IEnumerable<T> source,
T comma,
T and
) Summary
Inserts the comma item in between each element in the input collection except between the
second-last and last, where it inserts and instead. Generic type parametersT | This type parameter is not documented. |
Parametersthis IEnumerable<T> | source |
The input collection. | T | comma |
The element to insert between each consecutive pair of elements in the input collection except between the
second-last and last. | T | and |
The element to insert between the second-last and last element of the input collection. |
Returns
A collection containing the original collection with the extra element inserted. For example, new[] { "a",
"b", "c" }.InsertBetweenWithAnd(", ", " and ") returns { "a", ", ", "b", " and ", "c" }. |