Skip to content

M_CodeJam_Collections_Sequence_Create__2

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

Sequence.Create(T, TResult) Method (T, Func(T, Boolean), Func(T, T), Func(T, TResult))

Creates a sequence from start value and next element factory.

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

Syntax

C#

public static IEnumerable<TResult> Create<T, TResult>(
	T start,
	Func<T, bool> predicate,
	Func<T, T> next,
	Func<T, TResult> resultSelector
)

VB

Public Shared Function Create(Of T, TResult) ( 
	start As T,
	predicate As Func(Of T, Boolean),
	next As Func(Of T, T),
	resultSelector As Func(Of T, TResult)
) As IEnumerable(Of TResult)

F#

static member Create : 
        start : 'T * 
        predicate : Func<'T, bool> * 
        next : Func<'T, 'T> * 
        resultSelector : Func<'T, 'TResult> -> IEnumerable<'TResult> 

Parameters

 

start
Type: T
Start value.
predicate
Type: System.Func(T, Boolean)
A function to test each element for a condition.
next
Type: System.Func(T, T)
Next element factory.
resultSelector
Type: System.Func(T, TResult)
A transform function to apply to each element.

Type Parameters

 

T
The type of source element.
TResult
The type of result element

Return Value

Type: IEnumerable(TResult)
Generated sequence.

See Also

Reference

Sequence Class
Create Overload
CodeJam.Collections Namespace

Clone this wiki locally