Skip to content

M_CodeJam_Collections_EnumerableExtensions_CombineWithNext__2

Andrew Koryavchenko edited this page Jun 17, 2018 · 2 revisions

EnumerableExtensions.CombineWithNext(T, TResult) Method

Combines item with next value from the sequence.

Namespace: CodeJam.Collections
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0

Syntax

C#

public static IEnumerable<TResult> CombineWithNext<T, TResult>(
	this IEnumerable<T> source,
	T combineLast,
	Func<T, T, TResult> prevNextSelector
)

VB

<ExtensionAttribute>
Public Shared Function CombineWithNext(Of T, TResult) ( 
	source As IEnumerable(Of T),
	combineLast As T,
	prevNextSelector As Func(Of T, T, TResult)
) As IEnumerable(Of TResult)

F#

[<ExtensionAttribute>]
static member CombineWithNext : 
        source : IEnumerable<'T> * 
        combineLast : 'T * 
        prevNextSelector : Func<'T, 'T, 'TResult> -> IEnumerable<'TResult> 

Parameters

 

source
Type: System.Collections.Generic.IEnumerable(T)
The input sequence.
combineLast
Type: T
The value to be used as a next for the last item in the sequence.
prevNextSelector
Type: System.Func(T, T, TResult)
The previous next selector.

Type Parameters

 

T
The type of the item.
TResult
The type of the result.

Return Value

Type: IEnumerable(TResult)
Sequence of items combined with previous values from the sequence.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable(T). When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also

Reference

EnumerableExtensions Class
CodeJam.Collections Namespace

Clone this wiki locally