Skip to content

M_CodeJam_Collections_EnumerableExtensions_CombineWithPrevious__2_1

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

EnumerableExtensions.CombineWithPrevious(T, TResult) Method (IEnumerable(T), T, Func(T, T, TResult))

Combines item with previous value from the sequence.

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

Syntax

C#

public static IEnumerable<TResult> CombineWithPrevious<T, TResult>(
	this IEnumerable<T> source,
	T seed,
	Func<T, T, TResult> prevNextSelector
)

VB

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

F#

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

Parameters

 

source
Type: System.Collections.Generic.IEnumerable(T)
The input sequence.
seed
Type: T
The seed value to be used as a previous for the first 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
CombineWithPrevious Overload
CodeJam.Collections Namespace

Clone this wiki locally