-
Notifications
You must be signed in to change notification settings - Fork 35
M_CodeJam_Collections_Sequence_CreateWhileNotNull__2
Andrew Koryavchenko edited this page Jun 17, 2018
·
3 revisions
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
C#
public static IEnumerable<TResult> CreateWhileNotNull<T, TResult>(
T start,
Func<T, T> next,
Func<T, TResult> resultSelector
)
where T : class
VB
Public Shared Function CreateWhileNotNull(Of T As Class, TResult) (
start As T,
next As Func(Of T, T),
resultSelector As Func(Of T, TResult)
) As IEnumerable(Of TResult)
F#
static member CreateWhileNotNull :
start : 'T *
next : Func<'T, 'T> *
resultSelector : Func<'T, 'TResult> -> IEnumerable<'TResult> when 'T : not struct
- start
- Type: T
Start value. - next
- Type: System.Func(T, T)
Next element factory. - resultSelector
- Type: System.Func(T, TResult)
A transform function to apply to each element.
- T
- The type of source element.
- TResult
- The type of result element
Type: IEnumerable(TResult)
Generated sequence.
Sequence Class
CreateWhileNotNull Overload
CodeJam.Collections Namespace