Skip to content

M_CodeJam_Collections_Sequence_CreateWhileNotNull__1

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

Sequence.CreateWhileNotNull(T) Method (T, Func(T, T))

Creates a sequence from start value and next element factory till factory returns null.

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

Syntax

C#

public static IEnumerable<T> CreateWhileNotNull<T>(
	T start,
	Func<T, T> next
)
where T : class

VB

Public Shared Function CreateWhileNotNull(Of T As Class) ( 
	start As T,
	next As Func(Of T, T)
) As IEnumerable(Of T)

F#

static member CreateWhileNotNull : 
        start : 'T * 
        next : Func<'T, 'T> -> IEnumerable<'T>  when 'T : not struct

Parameters

 

start
Type: T
Start value.
next
Type: System.Func(T, T)
Next element factory.

Type Parameters

 

T
The type of element.

Return Value

Type: IEnumerable(T)
Generated sequence.

See Also

Reference

Sequence Class
CreateWhileNotNull Overload
CodeJam.Collections Namespace

Clone this wiki locally