EnumerableExWhileTResult Method |
Generates an enumerable sequence by repeating a source sequence as long as the given loop condition holds.
Namespace: System.LinqAssembly: System.Interactive (in System.Interactive.dll) Version: 1.2.0.0
Syntaxpublic static IEnumerable<TResult> While<TResult>(
Func<bool> condition,
IEnumerable<TResult> source
)
Parameters
- condition
- Type: SystemFuncBoolean
Loop condition. - source
- Type: System.Collections.GenericIEnumerableTResult
Sequence to repeat while the condition evaluates true.
Type Parameters
- TResult
- Result sequence element type.
Return Value
Type:
IEnumerableTResultSequence generated by repeating the given sequence while the condition evaluates to true.
See Also