Enumerable Routines
60 nodes
On this page 60
All
FunctionWhether every element passes a test; it stops at the first that does not. An empty sequence answers true.
All -> Truth
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>bool All(
IEnumerable<TSource> source,
Func<TSource, bool> predicate)Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to test. |
| predicate | Func<TSource, Truth> | — | The test for each element. |
Returns
| result | Truth |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Any
FunctionOverload 1 of 2
Any(source: IEnumerable<TSource>) -> Truth
bool Any(IEnumerable<TSource> source)
Whether the sequence has any elements at all; it reads at most one, so it is the cheap way to test for emptiness.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to test. |
Returns
| result | Truth |
Overload 2 of 2
Any -> Truth
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>bool Any(
IEnumerable<TSource> source,
Func<TSource, bool> predicate)Whether at least one element passes a test; it stops at the first that does. An empty sequence answers false.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to test. |
| predicate | Func<TSource, Truth> | — | The test for each element. |
Returns
| result | Truth |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Append
FunctionThe sequence with one more element at the end; the source itself is not changed.
Append -> IEnumerable<TSource>
source: IEnumerable<TSource>
element: TSourceIEnumerable<TSource> Append(
IEnumerable<TSource> source,
TSource element)Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to extend. |
| element | TSource | — | The element to add after the last one. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
As Enumerable
FunctionPasses the sequence through unchanged but typed as a plain sequence, hiding its concrete collection type so that later steps treat it only as something to enumerate. A null input comes back as null.
AsEnumerable(source: IEnumerable<TSource>) -> IEnumerable<TSource>
IEnumerable<TSource> AsEnumerable(IEnumerable<TSource> source)
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to pass through. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Average
FunctionOverload 1 of 20
Average(source: IEnumerable<Integer>) -> Number
double Average(IEnumerable<int> source)
The mean of the numbers, as a double so that it keeps its fraction. Throws System.InvalidOperationException when the sequence is empty.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Integer> | — | The numbers to average. |
Returns
| result | Number |
Overload 2 of 20
Average(source: IEnumerable<Large Integer>) -> Number
double Average(IEnumerable<long> source)
The mean of the numbers, as a double so that it keeps its fraction. Throws System.InvalidOperationException when the sequence is empty.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Large Integer> | — | The numbers to average. |
Returns
| result | Number |
Overload 3 of 20
Average(source: IEnumerable<Low Accuracy Number>) -> Low Accuracy Number
float Average(IEnumerable<float> source)
The mean of the numbers, worked out in double precision and rounded to float at the end. Throws System.InvalidOperationException when the sequence is empty.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Low Accuracy Number> | — | The numbers to average. |
Returns
| result | Low Accuracy Number |
Overload 4 of 20
Average(source: IEnumerable<Number>) -> Number
double Average(IEnumerable<double> source)
The mean of the numbers. Throws System.InvalidOperationException when the sequence is empty.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Number> | — | The numbers to average. |
Returns
| result | Number |
Overload 5 of 20
Average(source: IEnumerable<High Accuracy Number>) -> High Accuracy Number
decimal Average(IEnumerable<decimal> source)
The mean of the numbers, in decimal arithmetic. Throws System.InvalidOperationException when the sequence is empty.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<High Accuracy Number> | — | The numbers to average. |
Returns
| result | High Accuracy Number |
Overload 6 of 20
Average(source: IEnumerable<Optional Integer>) -> Optional Number
double? Average(IEnumerable<int?> source)
The mean of the numbers that are present, as a double; nulls are left out of both the total and the count, and an empty or all-null sequence gives null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Optional Integer> | — | The numbers to average, some of which may be missing. |
Returns
| result | Optional Number |
Overload 7 of 20
Average(source: IEnumerable<Optional Large Integer>) -> Optional Number
double? Average(IEnumerable<long?> source)
The mean of the numbers that are present, as a double; nulls are left out of both the total and the count, and an empty or all-null sequence gives null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Optional Large Integer> | — | The numbers to average, some of which may be missing. |
Returns
| result | Optional Number |
Overload 8 of 20
Average(source: IEnumerable<Optional Low Accuracy Number>) -> Optional Low Accuracy Number
float? Average(IEnumerable<float?> source)
The mean of the numbers that are present, worked out in double precision and rounded to float; nulls are left out of both the total and the count, and an empty or all-null sequence gives null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Optional Low Accuracy Number> | — | The numbers to average, some of which may be missing. |
Returns
| result | Optional Low Accuracy Number |
Overload 9 of 20
Average(source: IEnumerable<Optional Number>) -> Optional Number
double? Average(IEnumerable<double?> source)
The mean of the numbers that are present; nulls are left out of both the total and the count, and an empty or all-null sequence gives null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Optional Number> | — | The numbers to average, some of which may be missing. |
Returns
| result | Optional Number |
Overload 10 of 20
Average(source: IEnumerable<Optional High Accuracy Number>) -> Optional High Accuracy Number
decimal? Average(IEnumerable<decimal?> source)
The mean of the numbers that are present, in decimal arithmetic; nulls are left out of both the total and the count, and an empty or all-null sequence gives null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Optional High Accuracy Number> | — | The numbers to average, some of which may be missing. |
Returns
| result | Optional High Accuracy Number |
Overload 11 of 20
Average -> Number
source: IEnumerable<TSource>
selector: Func<TSource, Integer>double Average(
IEnumerable<TSource> source,
Func<TSource, int> selector)The mean of a number worked out from each element, for example the average age of a list of people, as a double. Throws System.InvalidOperationException when the sequence is empty.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to average over. |
| selector | Func<TSource, Integer> | — | Gives the number for each element. |
Returns
| result | Number |
Overload 12 of 20
Average -> Number
source: IEnumerable<TSource>
selector: Func<TSource, Large Integer>double Average(
IEnumerable<TSource> source,
Func<TSource, long> selector)The mean of a number worked out from each element, as a double. Throws System.InvalidOperationException when the sequence is empty.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to average over. |
| selector | Func<TSource, Large Integer> | — | Gives the number for each element. |
Returns
| result | Number |
Overload 13 of 20
Average -> Low Accuracy Number
source: IEnumerable<TSource>
selector: Func<TSource, Low Accuracy Number>float Average(
IEnumerable<TSource> source,
Func<TSource, float> selector)The mean of a number worked out from each element, worked out in double precision and rounded to float at the end. Throws System.InvalidOperationException when the sequence is empty.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to average over. |
| selector | Func<TSource, Low Accuracy Number> | — | Gives the number for each element. |
Returns
| result | Low Accuracy Number |
Overload 14 of 20
Average -> Number
source: IEnumerable<TSource>
selector: Func<TSource, Number>double Average(
IEnumerable<TSource> source,
Func<TSource, double> selector)The mean of a number worked out from each element. Throws System.InvalidOperationException when the sequence is empty.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to average over. |
| selector | Func<TSource, Number> | — | Gives the number for each element. |
Returns
| result | Number |
Overload 15 of 20
Average -> High Accuracy Number
source: IEnumerable<TSource>
selector: Func<TSource, High Accuracy Number>decimal Average(
IEnumerable<TSource> source,
Func<TSource, decimal> selector)The mean of a number worked out from each element, in decimal arithmetic. Throws System.InvalidOperationException when the sequence is empty.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to average over. |
| selector | Func<TSource, High Accuracy Number> | — | Gives the number for each element. |
Returns
| result | High Accuracy Number |
Overload 16 of 20
Average -> Optional Number
source: IEnumerable<TSource>
selector: Func<TSource, Optional Integer>double? Average(
IEnumerable<TSource> source,
Func<TSource, int?> selector)The mean of a possibly missing number worked out from each element, as a double; nulls are left out of both the total and the count, and an empty sequence or all nulls gives null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to average over. |
| selector | Func<TSource, Optional Integer> | — | Gives the number for each element, or null to leave it out. |
Returns
| result | Optional Number |
Overload 17 of 20
Average -> Optional Number
source: IEnumerable<TSource>
selector: Func<TSource, Optional Large Integer>double? Average(
IEnumerable<TSource> source,
Func<TSource, long?> selector)The mean of a possibly missing number worked out from each element, as a double; nulls are left out of both the total and the count, and an empty sequence or all nulls gives null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to average over. |
| selector | Func<TSource, Optional Large Integer> | — | Gives the number for each element, or null to leave it out. |
Returns
| result | Optional Number |
Overload 18 of 20
Average -> Optional Low Accuracy Number
source: IEnumerable<TSource>
selector: Func<TSource, Optional Low Accuracy Number>float? Average(
IEnumerable<TSource> source,
Func<TSource, float?> selector)The mean of a possibly missing number worked out from each element, in double precision rounded to float; nulls are left out of both the total and the count, and an empty sequence or all nulls gives null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to average over. |
| selector | Func<TSource, Optional Low Accuracy Number> | — | Gives the number for each element, or null to leave it out. |
Returns
| result | Optional Low Accuracy Number |
Overload 19 of 20
Average -> Optional Number
source: IEnumerable<TSource>
selector: Func<TSource, Optional Number>double? Average(
IEnumerable<TSource> source,
Func<TSource, double?> selector)The mean of a possibly missing number worked out from each element; nulls are left out of both the total and the count, and an empty sequence or all nulls gives null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to average over. |
| selector | Func<TSource, Optional Number> | — | Gives the number for each element, or null to leave it out. |
Returns
| result | Optional Number |
Overload 20 of 20
Average -> Optional High Accuracy Number
source: IEnumerable<TSource>
selector: Func<TSource, Optional High Accuracy Number>decimal? Average(
IEnumerable<TSource> source,
Func<TSource, decimal?> selector)The mean of a possibly missing number worked out from each element, in decimal arithmetic; nulls are left out of both the total and the count, and an empty sequence or all nulls gives null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to average over. |
| selector | Func<TSource, Optional High Accuracy Number> | — | Gives the number for each element, or null to leave it out. |
Returns
| result | Optional High Accuracy Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Cast
FunctionTreats every element of an untyped sequence as a T Result, for when all elements are known to be of that type. Only reference and unboxing conversions are applied (a boxed int does not become a long), and an element that cannot be cast throws System.InvalidCastException when it is reached; use EnumerableRoutines.OfType to drop such elements instead.
Cast(source: IEnumerable) -> IEnumerable<TResult>
IEnumerable<TResult> Cast(IEnumerable source)
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable | — | The untyped sequence to cast. |
Returns
| result | IEnumerable<TResult> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Chunk
FunctionSplits the sequence into consecutive batches of Size elements, for example to process items a page at a time; the last batch is shorter when the length is not a multiple of the size. Throws System.ArgumentOutOfRangeException when Size is less than 1.
Chunk -> IEnumerable<TSource Array>
source: IEnumerable<TSource>
size: IntegerIEnumerable<TSource[]> Chunk(
IEnumerable<TSource> source,
int size)Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to split. |
| size | Integer | — | The number of elements in each batch. |
Returns
| result | IEnumerable<TSource Array> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Concat
FunctionJoins two sequences end to end, keeping duplicates; use EnumerableRoutines.Union to merge without duplicates.
Concat -> IEnumerable<TSource>
first: IEnumerable<TSource>
second: IEnumerable<TSource>IEnumerable<TSource> Concat(
IEnumerable<TSource> first,
IEnumerable<TSource> second)Parameters
| name | type | default | description |
|---|---|---|---|
| first | IEnumerable<TSource> | — | The sequence whose elements come first. |
| second | IEnumerable<TSource> | — | The sequence whose elements follow. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Contains
FunctionOverload 1 of 2
Contains(source: IEnumerable<TSource>, value: TSource) -> Truth
bool Contains(IEnumerable<TSource> source, TSource value)
Whether the sequence holds an element equal to Value, by the elements' default equality.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to search. |
| value | TSource | — | The value to look for. |
Returns
| result | Truth |
Overload 2 of 2
Contains -> Truth
source: IEnumerable<TSource>
value: TSource
comparer: IEqualityComparer<TSource>bool Contains(
IEnumerable<TSource> source,
TSource value,
IEqualityComparer<TSource> comparer)Whether the sequence holds an element equal to Value, with Comparer deciding equality (for example text compared without regard to case).
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to search. |
| value | TSource | — | The value to look for. |
| comparer | IEqualityComparer<TSource> | — | Decides whether two elements are equal; null uses the default equality. |
Returns
| result | Truth |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Count
FunctionOverload 1 of 2
Count(source: IEnumerable<TSource>) -> Integer
int Count(IEnumerable<TSource> source)
How many elements the sequence has. Throws System.OverflowException beyond Int32.MaxValue elements; use EnumerableRoutines.LongCount for sequences that long.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to count. |
Returns
| result | Integer |
Overload 2 of 2
Count -> Integer
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>int Count(
IEnumerable<TSource> source,
Func<TSource, bool> predicate)How many elements pass a test. Throws System.OverflowException beyond Int32.MaxValue matches.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to count in. |
| predicate | Func<TSource, Truth> | — | Answers true for each element to count. |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Default If Empty
FunctionOverload 1 of 2
DefaultIfEmpty(source: IEnumerable<TSource>) -> IEnumerable<TSource>
IEnumerable<TSource> DefaultIfEmpty(IEnumerable<TSource> source)
The sequence unchanged when it has any elements; when it is empty, a sequence holding exactly one default value instead (null for reference and nullable types, zero or false for numbers and booleans), so that a later step always has something to work on.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence that might be empty. |
Returns
| result | IEnumerable<TSource> |
Overload 2 of 2
DefaultIfEmpty -> IEnumerable<TSource>
source: IEnumerable<TSource>
defaultValue: TSourceIEnumerable<TSource> DefaultIfEmpty(
IEnumerable<TSource> source,
TSource defaultValue)The sequence unchanged when it has any elements; when it is empty, a sequence holding exactly one Default Value instead, so that a later step always has something to work on.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence that might be empty. |
| defaultValue | TSource | — | The single element to give when Source is empty. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Distinct
FunctionOverload 1 of 2
Distinct(source: IEnumerable<TSource>) -> IEnumerable<TSource>
IEnumerable<TSource> Distinct(IEnumerable<TSource> source)
The sequence with repeated elements removed, comparing elements by their default equality; the first occurrence of each is kept, in the order they first appear.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to remove duplicates from. |
Returns
| result | IEnumerable<TSource> |
Overload 2 of 2
Distinct -> IEnumerable<TSource>
source: IEnumerable<TSource>
comparer: IEqualityComparer<TSource>IEnumerable<TSource> Distinct(
IEnumerable<TSource> source,
IEqualityComparer<TSource> comparer)The sequence with repeated elements removed, using Comparer to decide which elements are the same (for example text compared without regard to case); the first occurrence of each is kept, in the order they first appear.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to remove duplicates from. |
| comparer | IEqualityComparer<TSource> | — | Decides whether two elements are equal; null uses the default equality. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Distinct By
FunctionOverload 1 of 2
DistinctBy -> IEnumerable<TSource>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>IEnumerable<TSource> DistinctBy(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector)One element per key, for example one person per surname: the first element seen with each key is kept, in their original order.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to remove duplicates from. |
| keySelector | Func<TSource, TKey> | — | Gives the key that decides whether two elements count as the same. |
Returns
| result | IEnumerable<TSource> |
Overload 2 of 2
DistinctBy -> IEnumerable<TSource>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
comparer: IEqualityComparer<TKey>IEnumerable<TSource> DistinctBy(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
IEqualityComparer<TKey> comparer)One element per key, with Comparer deciding which keys are the same; the first element seen with each key is kept, in their original order.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to remove duplicates from. |
| keySelector | Func<TSource, TKey> | — | Gives the key that decides whether two elements count as the same. |
| comparer | IEqualityComparer<TKey> | — | Decides whether two keys are equal; null uses the default equality. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Element At
FunctionThe element at a position, counting from zero. Throws System.ArgumentOutOfRangeException when Index is negative or not less than the number of elements.
ElementAt -> TSource
source: IEnumerable<TSource>
index: IntegerTSource ElementAt(IEnumerable<TSource> source, int index)
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to read. |
| index | Integer | — | The zero-based position of the element. |
Returns
| Result | TSource |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Element At Or Default
FunctionThe element at a position, counting from zero, or the type's default value (null for reference and nullable types, zero for numbers) when Index is negative or past the end.
ElementAtOrDefault -> TSource
source: IEnumerable<TSource>
index: IntegerTSource ElementAtOrDefault(
IEnumerable<TSource> source,
int index)Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to read. |
| index | Integer | — | The zero-based position of the element. |
Returns
| Result | TSource |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Empty
FunctionA sequence with no elements, for use as a starting point or as a placeholder where a sequence input is required.
Empty() -> IEnumerable<TSource>
IEnumerable<TSource> Empty()
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Except
FunctionOverload 1 of 2
Except -> IEnumerable<TSource>
first: IEnumerable<TSource>
second: IEnumerable<TSource>IEnumerable<TSource> Except(
IEnumerable<TSource> first,
IEnumerable<TSource> second)The distinct elements of First that do not appear in Second, in the order of First. This is a set difference, so repeats within First are removed as well.
Parameters
| name | type | default | description |
|---|---|---|---|
| first | IEnumerable<TSource> | — | The sequence to take elements from. |
| second | IEnumerable<TSource> | — | The elements to leave out. |
Returns
| result | IEnumerable<TSource> |
Overload 2 of 2
Except -> IEnumerable<TSource>
first: IEnumerable<TSource>
second: IEnumerable<TSource>
comparer: IEqualityComparer<TSource>IEnumerable<TSource> Except(
IEnumerable<TSource> first,
IEnumerable<TSource> second,
IEqualityComparer<TSource> comparer)The distinct elements of First that do not appear in Second, with Comparer deciding which elements are the same; repeats within First are removed as well.
Parameters
| name | type | default | description |
|---|---|---|---|
| first | IEnumerable<TSource> | — | The sequence to take elements from. |
| second | IEnumerable<TSource> | — | The elements to leave out. |
| comparer | IEqualityComparer<TSource> | — | Decides whether two elements are equal; null uses the default equality. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Except By
FunctionOverload 1 of 2
ExceptBy -> IEnumerable<TSource>
first: IEnumerable<TSource>
second: IEnumerable<TKey>
keySelector: Func<TSource, TKey>IEnumerable<TSource> ExceptBy(
IEnumerable<TSource> first,
IEnumerable<TKey> second,
Func<TSource, TKey> keySelector)The elements of First whose key is not in a list of keys, for example everyone except the IDs in an exclusion list; one element per key, the first seen, in the order of First.
Parameters
| name | type | default | description |
|---|---|---|---|
| first | IEnumerable<TSource> | — | The sequence to take elements from. |
| second | IEnumerable<TKey> | — | The keys to leave out. |
| keySelector | Func<TSource, TKey> | — | Gives the key of each element of First. |
Returns
| result | IEnumerable<TSource> |
Overload 2 of 2
ExceptBy -> IEnumerable<TSource>
first: IEnumerable<TSource>
second: IEnumerable<TKey>
keySelector: Func<TSource, TKey>
comparer: IEqualityComparer<TKey>IEnumerable<TSource> ExceptBy(
IEnumerable<TSource> first,
IEnumerable<TKey> second,
Func<TSource, TKey> keySelector,
IEqualityComparer<TKey> comparer)The elements of First whose key is not in a list of keys, with Comparer deciding which keys are the same; one element per key, the first seen.
Parameters
| name | type | default | description |
|---|---|---|---|
| first | IEnumerable<TSource> | — | The sequence to take elements from. |
| second | IEnumerable<TKey> | — | The keys to leave out. |
| keySelector | Func<TSource, TKey> | — | Gives the key of each element of First. |
| comparer | IEqualityComparer<TKey> | — | Decides whether two keys are equal; null uses the default equality. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
First
FunctionOverload 1 of 2
First(source: IEnumerable<TSource>) -> TSource
TSource First(IEnumerable<TSource> source)
The first element. Throws System.InvalidOperationException when the sequence is empty; use EnumerableRoutines.FirstOrDefault to get a fallback instead.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to read. |
Returns
| Result | TSource |
Overload 2 of 2
First -> TSource
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>TSource First(
IEnumerable<TSource> source,
Func<TSource, bool> predicate)The first element that passes a test. Throws System.InvalidOperationException when none does.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to search. |
| predicate | Func<TSource, Truth> | — | The test each element is checked against, in order. |
Returns
| Result | TSource |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
First Or Default
FunctionOverload 1 of 4
FirstOrDefault(source: IEnumerable<TSource>) -> TSource
TSource FirstOrDefault(IEnumerable<TSource> source)
The first element, or the type's default value (null for reference and nullable types, zero for numbers) when the sequence is empty.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to read. |
Returns
| Result | TSource |
Overload 2 of 4
FirstOrDefault -> TSource
source: IEnumerable<TSource>
defaultValue: TSourceTSource FirstOrDefault(
IEnumerable<TSource> source,
TSource defaultValue)The first element, or Default Value when the sequence is empty.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to read. |
| defaultValue | TSource | — | What to give when there is no element. |
Returns
| Result | TSource |
Overload 3 of 4
FirstOrDefault -> TSource
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>TSource FirstOrDefault(
IEnumerable<TSource> source,
Func<TSource, bool> predicate)The first element that passes a test, or the type's default value (null for reference and nullable types, zero for numbers) when none does.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to search. |
| predicate | Func<TSource, Truth> | — | The test each element is checked against, in order. |
Returns
| Result | TSource |
Overload 4 of 4
FirstOrDefault -> TSource
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>
defaultValue: TSourceTSource FirstOrDefault(
IEnumerable<TSource> source,
Func<TSource, bool> predicate,
TSource defaultValue)The first element that passes a test, or Default Value when none does.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to search. |
| predicate | Func<TSource, Truth> | — | The test each element is checked against, in order. |
| defaultValue | TSource | — | What to give when no element passes. |
Returns
| Result | TSource |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Group By
FunctionOverload 1 of 8
GroupBy -> IEnumerable<IGrouping<TKey, TSource>>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>IEnumerable<IGrouping<TKey, TSource>> GroupBy(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector)Gathers elements that share a key into groups, for example orders by customer. Each group carries its key and its elements in their original order, and groups come in the order their keys first appear.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to group. |
| keySelector | Func<TSource, TKey> | — | Gives the key that decides each element's group. |
Returns
| result | IEnumerable<IGrouping<TKey, TSource>> |
Overload 2 of 8
GroupBy -> IEnumerable<IGrouping<TKey, TSource>>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
comparer: IEqualityComparer<TKey>IEnumerable<IGrouping<TKey, TSource>> GroupBy(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
IEqualityComparer<TKey> comparer)Gathers elements that share a key into groups, with Comparer deciding which keys are the same (for example names compared without regard to case). Groups come in the order their keys first appear.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to group. |
| keySelector | Func<TSource, TKey> | — | Gives the key that decides each element's group. |
| comparer | IEqualityComparer<TKey> | — | Decides whether two keys are equal; null uses the default equality. |
Returns
| result | IEnumerable<IGrouping<TKey, TSource>> |
Overload 3 of 8
GroupBy -> IEnumerable<IGrouping<TKey, TElement>>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
elementSelector: Func<TSource, TElement>IEnumerable<IGrouping<TKey, TElement>> GroupBy(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
Func<TSource, TElement> elementSelector)Gathers elements that share a key into groups, storing only the part of each element that Element Selector picks out, for example order amounts grouped by customer.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to group. |
| keySelector | Func<TSource, TKey> | — | Gives the key that decides each element's group. |
| elementSelector | Func<TSource, TElement> | — | Gives the value stored in the group for each element. |
Returns
| result | IEnumerable<IGrouping<TKey, TElement>> |
Overload 4 of 8
GroupBy -> IEnumerable<IGrouping<TKey, TElement>>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
elementSelector: Func<TSource, TElement>
comparer: IEqualityComparer<TKey>IEnumerable<IGrouping<TKey, TElement>> GroupBy(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
Func<TSource, TElement> elementSelector,
IEqualityComparer<TKey> comparer)Gathers elements that share a key into groups, storing only the part of each element that Element Selector picks out, with Comparer deciding which keys are the same.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to group. |
| keySelector | Func<TSource, TKey> | — | Gives the key that decides each element's group. |
| elementSelector | Func<TSource, TElement> | — | Gives the value stored in the group for each element. |
| comparer | IEqualityComparer<TKey> | — | Decides whether two keys are equal; null uses the default equality. |
Returns
| result | IEnumerable<IGrouping<TKey, TElement>> |
Overload 5 of 8
GroupBy -> IEnumerable<TResult>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
resultSelector: Func<TKey, IEnumerable<TSource>, TResult>IEnumerable<TResult> GroupBy(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
Func<TKey, IEnumerable<TSource>, TResult> resultSelector)Groups elements by key and turns each group into a single result, for example one (customer, number of orders) value per customer.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to group. |
| keySelector | Func<TSource, TKey> | — | Gives the key that decides each element's group. |
| resultSelector | Func<TKey, IEnumerable<TSource>, TResult> | — | Receives a key and its group's elements and gives the result for that group. |
Returns
| result | IEnumerable<TResult> |
Overload 6 of 8
GroupBy -> IEnumerable<TResult>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
resultSelector: Func<TKey, IEnumerable<TSource>, TResult>
comparer: IEqualityComparer<TKey>IEnumerable<TResult> GroupBy(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
Func<TKey, IEnumerable<TSource>, TResult> resultSelector,
IEqualityComparer<TKey> comparer)Groups elements by key and turns each group into a single result, with Comparer deciding which keys are the same.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to group. |
| keySelector | Func<TSource, TKey> | — | Gives the key that decides each element's group. |
| resultSelector | Func<TKey, IEnumerable<TSource>, TResult> | — | Receives a key and its group's elements and gives the result for that group. |
| comparer | IEqualityComparer<TKey> | — | Decides whether two keys are equal; null uses the default equality. |
Returns
| result | IEnumerable<TResult> |
Overload 7 of 8
GroupBy -> IEnumerable<TResult>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
elementSelector: Func<TSource, TElement>
resultSelector: Func<TKey, IEnumerable<TElement>, TResult>IEnumerable<TResult> GroupBy(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
Func<TSource, TElement> elementSelector,
Func<TKey, IEnumerable<TElement>, TResult> resultSelector)Groups elements by key, keeps only the part of each element that Element Selector picks out, and turns each group into a single result, for example one (customer, total spent) value per customer.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to group. |
| keySelector | Func<TSource, TKey> | — | Gives the key that decides each element's group. |
| elementSelector | Func<TSource, TElement> | — | Gives the value kept in the group for each element. |
| resultSelector | Func<TKey, IEnumerable<TElement>, TResult> | — | Receives a key and its group's values and gives the result for that group. |
Returns
| result | IEnumerable<TResult> |
Overload 8 of 8
GroupBy -> IEnumerable<TResult>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
elementSelector: Func<TSource, TElement>
resultSelector: Func<TKey, IEnumerable<TElement>, TResult>
comparer: IEqualityComparer<TKey>IEnumerable<TResult> GroupBy(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
Func<TSource, TElement> elementSelector,
Func<TKey, IEnumerable<TElement>, TResult> resultSelector,
IEqualityComparer<TKey> comparer)Groups elements by key, keeps only the part of each element that Element Selector picks out, and turns each group into a single result, with Comparer deciding which keys are the same.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to group. |
| keySelector | Func<TSource, TKey> | — | Gives the key that decides each element's group. |
| elementSelector | Func<TSource, TElement> | — | Gives the value kept in the group for each element. |
| resultSelector | Func<TKey, IEnumerable<TElement>, TResult> | — | Receives a key and its group's values and gives the result for that group. |
| comparer | IEqualityComparer<TKey> | — | Decides whether two keys are equal; null uses the default equality. |
Returns
| result | IEnumerable<TResult> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Group Join
FunctionOverload 1 of 2
GroupJoin -> IEnumerable<TResult>
outer: IEnumerable<TOuter>
inner: IEnumerable<TInner>
outerKeySelector: Func<TOuter, TKey>
innerKeySelector: Func<TInner, TKey>
resultSelector: Func<TOuter, IEnumerable<TInner>, TResult>IEnumerable<TResult> GroupJoin(
IEnumerable<TOuter> outer,
IEnumerable<TInner> inner,
Func<TOuter, TKey> outerKeySelector,
Func<TInner, TKey> innerKeySelector,
Func<TOuter, IEnumerable<TInner>, TResult> resultSelector)Pairs each element of Outer with all the elements of Inner that share its key, for example each customer with their orders. Unlike Join, every outer element gives a result, with an empty collection when nothing matches, which makes this the basis of a left outer join.
Parameters
| name | type | default | description |
|---|---|---|---|
| outer | IEnumerable<TOuter> | — | The sequence that gives one result per element. |
| inner | IEnumerable<TInner> | — | The sequence whose elements are collected under matching outer elements. |
| outerKeySelector | Func<TOuter, TKey> | — | Gives the key of each element of Outer. |
| innerKeySelector | Func<TInner, TKey> | — | Gives the key of each element of Inner. |
| resultSelector | Func<TOuter, IEnumerable<TInner>, TResult> | — | Receives an outer element and its matching inner elements and gives the result. |
Returns
| result | IEnumerable<TResult> |
Overload 2 of 2
GroupJoin -> IEnumerable<TResult>
outer: IEnumerable<TOuter>
inner: IEnumerable<TInner>
outerKeySelector: Func<TOuter, TKey>
innerKeySelector: Func<TInner, TKey>
resultSelector: Func<TOuter, IEnumerable<TInner>, TResult>
comparer: IEqualityComparer<TKey>IEnumerable<TResult> GroupJoin(
IEnumerable<TOuter> outer,
IEnumerable<TInner> inner,
Func<TOuter, TKey> outerKeySelector,
Func<TInner, TKey> innerKeySelector,
Func<TOuter, IEnumerable<TInner>, TResult> resultSelector,
IEqualityComparer<TKey> comparer)Pairs each element of Outer with all the elements of Inner that share its key, with Comparer deciding which keys are equal; every outer element gives a result, with an empty collection when nothing matches.
Parameters
| name | type | default | description |
|---|---|---|---|
| outer | IEnumerable<TOuter> | — | The sequence that gives one result per element. |
| inner | IEnumerable<TInner> | — | The sequence whose elements are collected under matching outer elements. |
| outerKeySelector | Func<TOuter, TKey> | — | Gives the key of each element of Outer. |
| innerKeySelector | Func<TInner, TKey> | — | Gives the key of each element of Inner. |
| resultSelector | Func<TOuter, IEnumerable<TInner>, TResult> | — | Receives an outer element and its matching inner elements and gives the result. |
| comparer | IEqualityComparer<TKey> | — | Decides whether two keys are equal; null uses the default equality. |
Returns
| result | IEnumerable<TResult> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Intersect
FunctionOverload 1 of 2
Intersect -> IEnumerable<TSource>
first: IEnumerable<TSource>
second: IEnumerable<TSource>IEnumerable<TSource> Intersect(
IEnumerable<TSource> first,
IEnumerable<TSource> second)The distinct elements of First that also appear in Second, in the order of First.
Parameters
| name | type | default | description |
|---|---|---|---|
| first | IEnumerable<TSource> | — | The sequence whose elements are kept. |
| second | IEnumerable<TSource> | — | The sequence an element must also appear in. |
Returns
| result | IEnumerable<TSource> |
Overload 2 of 2
Intersect -> IEnumerable<TSource>
first: IEnumerable<TSource>
second: IEnumerable<TSource>
comparer: IEqualityComparer<TSource>IEnumerable<TSource> Intersect(
IEnumerable<TSource> first,
IEnumerable<TSource> second,
IEqualityComparer<TSource> comparer)The distinct elements of First that also appear in Second, with Comparer deciding which elements are the same.
Parameters
| name | type | default | description |
|---|---|---|---|
| first | IEnumerable<TSource> | — | The sequence whose elements are kept. |
| second | IEnumerable<TSource> | — | The sequence an element must also appear in. |
| comparer | IEqualityComparer<TSource> | — | Decides whether two elements are equal; null uses the default equality. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Intersect By
FunctionOverload 1 of 2
IntersectBy -> IEnumerable<TSource>
first: IEnumerable<TSource>
second: IEnumerable<TKey>
keySelector: Func<TSource, TKey>IEnumerable<TSource> IntersectBy(
IEnumerable<TSource> first,
IEnumerable<TKey> second,
Func<TSource, TKey> keySelector)The elements of First whose key appears in a list of keys, for example the people whose IDs are in a selection; one element per key, the first seen, in the order of First.
Parameters
| name | type | default | description |
|---|---|---|---|
| first | IEnumerable<TSource> | — | The sequence whose elements are kept. |
| second | IEnumerable<TKey> | — | The keys an element's key must be among. |
| keySelector | Func<TSource, TKey> | — | Gives the key of each element of First. |
Returns
| result | IEnumerable<TSource> |
Overload 2 of 2
IntersectBy -> IEnumerable<TSource>
first: IEnumerable<TSource>
second: IEnumerable<TKey>
keySelector: Func<TSource, TKey>
comparer: IEqualityComparer<TKey>IEnumerable<TSource> IntersectBy(
IEnumerable<TSource> first,
IEnumerable<TKey> second,
Func<TSource, TKey> keySelector,
IEqualityComparer<TKey> comparer)The elements of First whose key appears in a list of keys, with Comparer deciding which keys are the same; one element per key, the first seen.
Parameters
| name | type | default | description |
|---|---|---|---|
| first | IEnumerable<TSource> | — | The sequence whose elements are kept. |
| second | IEnumerable<TKey> | — | The keys an element's key must be among. |
| keySelector | Func<TSource, TKey> | — | Gives the key of each element of First. |
| comparer | IEqualityComparer<TKey> | — | Decides whether two keys are equal; null uses the default equality. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Join
FunctionOverload 1 of 2
Join -> IEnumerable<TResult>
outer: IEnumerable<TOuter>
inner: IEnumerable<TInner>
outerKeySelector: Func<TOuter, TKey>
innerKeySelector: Func<TInner, TKey>
resultSelector: Func<TOuter, TInner, TResult>IEnumerable<TResult> Join(
IEnumerable<TOuter> outer,
IEnumerable<TInner> inner,
Func<TOuter, TKey> outerKeySelector,
Func<TInner, TKey> innerKeySelector,
Func<TOuter, TInner, TResult> resultSelector)Matches elements of two sequences by key (an inner join), for example orders to their customers: every pair whose keys are equal gives one result. Elements with no match on the other side are left out, and null keys never match. Results follow the order of Outer, and within each, the order of Inner.
Parameters
| name | type | default | description |
|---|---|---|---|
| outer | IEnumerable<TOuter> | — | The first sequence to join. |
| inner | IEnumerable<TInner> | — | The sequence to match against. |
| outerKeySelector | Func<TOuter, TKey> | — | Gives the key of each element of Outer. |
| innerKeySelector | Func<TInner, TKey> | — | Gives the key of each element of Inner. |
| resultSelector | Func<TOuter, TInner, TResult> | — | Combines a matching pair into a result. |
Returns
| result | IEnumerable<TResult> |
Overload 2 of 2
Join -> IEnumerable<TResult>
outer: IEnumerable<TOuter>
inner: IEnumerable<TInner>
outerKeySelector: Func<TOuter, TKey>
innerKeySelector: Func<TInner, TKey>
resultSelector: Func<TOuter, TInner, TResult>
comparer: IEqualityComparer<TKey>IEnumerable<TResult> Join(
IEnumerable<TOuter> outer,
IEnumerable<TInner> inner,
Func<TOuter, TKey> outerKeySelector,
Func<TInner, TKey> innerKeySelector,
Func<TOuter, TInner, TResult> resultSelector,
IEqualityComparer<TKey> comparer)Matches elements of two sequences by key (an inner join), with Comparer deciding which keys are equal; every matching pair gives one result and unmatched elements are left out.
Parameters
| name | type | default | description |
|---|---|---|---|
| outer | IEnumerable<TOuter> | — | The first sequence to join. |
| inner | IEnumerable<TInner> | — | The sequence to match against. |
| outerKeySelector | Func<TOuter, TKey> | — | Gives the key of each element of Outer. |
| innerKeySelector | Func<TInner, TKey> | — | Gives the key of each element of Inner. |
| resultSelector | Func<TOuter, TInner, TResult> | — | Combines a matching pair into a result. |
| comparer | IEqualityComparer<TKey> | — | Decides whether two keys are equal; null uses the default equality. |
Returns
| result | IEnumerable<TResult> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Last
FunctionOverload 1 of 2
Last(source: IEnumerable<TSource>) -> TSource
TSource Last(IEnumerable<TSource> source)
The last element. Throws System.InvalidOperationException when the sequence is empty; use EnumerableRoutines.LastOrDefault to get a fallback instead.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to read. |
Returns
| Result | TSource |
Overload 2 of 2
Last -> TSource
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>TSource Last(
IEnumerable<TSource> source,
Func<TSource, bool> predicate)The last element that passes a test. Throws System.InvalidOperationException when none does.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to search. |
| predicate | Func<TSource, Truth> | — | The test each element is checked against. |
Returns
| Result | TSource |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Last Or Default
FunctionOverload 1 of 4
LastOrDefault(source: IEnumerable<TSource>) -> TSource
TSource LastOrDefault(IEnumerable<TSource> source)
The last element, or the type's default value (null for reference and nullable types, zero for numbers) when the sequence is empty.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to read. |
Returns
| Result | TSource |
Overload 2 of 4
LastOrDefault -> TSource
source: IEnumerable<TSource>
defaultValue: TSourceTSource LastOrDefault(
IEnumerable<TSource> source,
TSource defaultValue)The last element, or Default Value when the sequence is empty.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to read. |
| defaultValue | TSource | — | What to give when there is no element. |
Returns
| Result | TSource |
Overload 3 of 4
LastOrDefault -> TSource
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>TSource LastOrDefault(
IEnumerable<TSource> source,
Func<TSource, bool> predicate)The last element that passes a test, or the type's default value (null for reference and nullable types, zero for numbers) when none does.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to search. |
| predicate | Func<TSource, Truth> | — | The test each element is checked against. |
Returns
| Result | TSource |
Overload 4 of 4
LastOrDefault -> TSource
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>
defaultValue: TSourceTSource LastOrDefault(
IEnumerable<TSource> source,
Func<TSource, bool> predicate,
TSource defaultValue)The last element that passes a test, or Default Value when none does.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to search. |
| predicate | Func<TSource, Truth> | — | The test each element is checked against. |
| defaultValue | TSource | — | What to give when no element passes. |
Returns
| Result | TSource |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Long Count
FunctionOverload 1 of 2
LongCount(source: IEnumerable<TSource>) -> Large Integer
long LongCount(IEnumerable<TSource> source)
How many elements the sequence has, as a 64-bit number for sequences too long for EnumerableRoutines.Count.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to count. |
Returns
| result | Large Integer |
Overload 2 of 2
LongCount -> Large Integer
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>long LongCount(
IEnumerable<TSource> source,
Func<TSource, bool> predicate)How many elements pass a test, as a 64-bit number.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to count in. |
| predicate | Func<TSource, Truth> | — | Answers true for each element to count. |
Returns
| result | Large Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Max
FunctionOverload 1 of 2
Max(source: IEnumerable<TSource>) -> TSource
TSource Max(IEnumerable<TSource> source)
The largest element, by the elements' default comparison. For reference or nullable element types, nulls are ignored and an empty sequence (or one holding only nulls) gives null; for non-nullable value types such as plain numbers, an empty sequence throws System.InvalidOperationException.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to search; its elements must be comparable. |
Returns
| Result | TSource |
Overload 2 of 2
Max -> TResult
source: IEnumerable<TSource>
selector: Func<TSource, TResult>TResult Max(
IEnumerable<TSource> source,
Func<TSource, TResult> selector)The largest value that Selector gives for any element, for example the highest score in a list of players. For reference or nullable result types, nulls are ignored and an empty sequence gives null; for non-nullable value types such as plain numbers, an empty sequence throws System.InvalidOperationException.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to search. |
| selector | Func<TSource, TResult> | — | Gives the comparable value for each element. |
Returns
| Result | TResult |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Min
FunctionOverload 1 of 2
Min(source: IEnumerable<TSource>) -> TSource
TSource Min(IEnumerable<TSource> source)
The smallest element, by the elements' default comparison. For reference or nullable element types, nulls are ignored and an empty sequence (or one holding only nulls) gives null; for non-nullable value types such as plain numbers, an empty sequence throws System.InvalidOperationException.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to search; its elements must be comparable. |
Returns
| Result | TSource |
Overload 2 of 2
Min -> TResult
source: IEnumerable<TSource>
selector: Func<TSource, TResult>TResult Min(
IEnumerable<TSource> source,
Func<TSource, TResult> selector)The smallest value that Selector gives for any element, for example the lowest price in a list of items. For reference or nullable result types, nulls are ignored and an empty sequence gives null; for non-nullable value types such as plain numbers, an empty sequence throws System.InvalidOperationException.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to search. |
| selector | Func<TSource, TResult> | — | Gives the comparable value for each element. |
Returns
| Result | TResult |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Of Type
FunctionKeeps only the elements of an untyped sequence that are a T Result (or derive from it); nulls and elements of any other type are dropped, so unlike EnumerableRoutines.Cast it never throws for a mismatched element.
OfType(source: IEnumerable) -> IEnumerable<TResult>
IEnumerable<TResult> OfType(IEnumerable source)
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable | — | The untyped sequence to filter. |
Returns
| result | IEnumerable<TResult> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Order
FunctionThe elements sorted from smallest to largest by their default comparison (numbers by value, text in the current culture's order). The sort is stable, so equal elements keep their original order; the elements must be comparable, otherwise sorting fails when the result is read.
Order(source: IEnumerable<TSource>) -> IEnumerable<TSource>
IEnumerable<TSource> Order(IEnumerable<TSource> source)
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to sort. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Order By
FunctionOverload 1 of 2
OrderBy -> IOrderedEnumerable<TSource>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>IOrderedEnumerable<TSource> OrderBy(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector)Sorts elements from smallest to largest by a key worked out from each, for example people by age. The sort is stable, so elements with equal keys keep their original order; follow it with EnumerableRoutines.ThenBy to break ties with a second key.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to sort. |
| keySelector | Func<TSource, TKey> | — | Gives the key to sort each element by. |
Returns
| result | IOrderedEnumerable<TSource> |
Overload 2 of 2
OrderBy -> IOrderedEnumerable<TSource>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
comparer: IComparer<TKey>IOrderedEnumerable<TSource> OrderBy(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
IComparer<TKey> comparer)Sorts elements from smallest to largest by a key worked out from each, with Comparer deciding how keys are ordered. The sort is stable, so elements with equal keys keep their original order.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to sort. |
| keySelector | Func<TSource, TKey> | — | Gives the key to sort each element by. |
| comparer | IComparer<TKey> | — | Decides which of two keys comes first; null uses the key type's default comparison. |
Returns
| result | IOrderedEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Order By Descending
FunctionOverload 1 of 2
OrderByDescending -> IOrderedEnumerable<TSource>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>IOrderedEnumerable<TSource> OrderByDescending(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector)Sorts elements from largest to smallest by a key worked out from each, for example scores from highest to lowest. The sort is stable, so elements with equal keys keep their original order.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to sort. |
| keySelector | Func<TSource, TKey> | — | Gives the key to sort each element by. |
Returns
| result | IOrderedEnumerable<TSource> |
Overload 2 of 2
OrderByDescending -> IOrderedEnumerable<TSource>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
comparer: IComparer<TKey>IOrderedEnumerable<TSource> OrderByDescending(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
IComparer<TKey> comparer)Sorts elements from largest to smallest by a key worked out from each, with Comparer deciding how keys are ordered. The sort is stable, so elements with equal keys keep their original order.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to sort. |
| keySelector | Func<TSource, TKey> | — | Gives the key to sort each element by. |
| comparer | IComparer<TKey> | — | Decides which of two keys comes first; null uses the key type's default comparison. |
Returns
| result | IOrderedEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Order Descending
FunctionThe elements sorted from largest to smallest by their default comparison. The sort is stable, so equal elements keep their original order; the elements must be comparable, otherwise sorting fails when the result is read.
OrderDescending(source: IEnumerable<TSource>) -> IEnumerable<TSource>
IEnumerable<TSource> OrderDescending(IEnumerable<TSource> source)
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to sort. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Prepend
FunctionThe sequence with one more element at the start; the source itself is not changed.
Prepend -> IEnumerable<TSource>
source: IEnumerable<TSource>
element: TSourceIEnumerable<TSource> Prepend(
IEnumerable<TSource> source,
TSource element)Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to extend. |
| element | TSource | — | The element to put before the first one. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Range
FunctionA run of consecutive whole numbers: Count of them, starting at Start, so a start of 1 and a count of 10 gives 1 to 10. Throws System.ArgumentOutOfRangeException when Count is negative or the last number would exceed Int32.MaxValue.
Range(start: Integer, count: Integer) -> IEnumerable<Integer>
IEnumerable<int> Range(int start, int count)
Parameters
| name | type | default | description |
|---|---|---|---|
| start | Integer | — | The first number. |
| count | Integer | — | How many numbers to give; zero gives an empty sequence. |
Returns
| result | IEnumerable<Integer> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Repeat
FunctionA sequence holding the same value Count times. For a reference type every entry is the same object, not a copy. Throws System.ArgumentOutOfRangeException when Count is negative.
Repeat(element: TResult, count: Integer) -> IEnumerable<TResult>
IEnumerable<TResult> Repeat(TResult element, int count)
Parameters
| name | type | default | description |
|---|---|---|---|
| element | TResult | — | The value to repeat. |
| count | Integer | — | How many times to repeat it; zero gives an empty sequence. |
Returns
| result | IEnumerable<TResult> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Reverse
FunctionThe elements in reverse order. The whole source is read before the first result is given, and the source itself is not changed.
Reverse(source: IEnumerable<TSource>) -> IEnumerable<TSource>
IEnumerable<TSource> Reverse(IEnumerable<TSource> source)
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to reverse. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Select
FunctionOverload 1 of 2
Select -> IEnumerable<TResult>
source: IEnumerable<TSource>
selector: Func<TSource, TResult>IEnumerable<TResult> Select(
IEnumerable<TSource> source,
Func<TSource, TResult> selector)Transforms each element through Selector, for example from a list of people to a list of their names.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to transform. |
| selector | Func<TSource, TResult> | — | Gives the result for one element. |
Returns
| result | IEnumerable<TResult> |
Overload 2 of 2
Select -> IEnumerable<TResult>
source: IEnumerable<TSource>
selector: Func<TSource, Integer, TResult>IEnumerable<TResult> Select(
IEnumerable<TSource> source,
Func<TSource, int, TResult> selector)Transforms each element through Selector, which also receives the element's position, for example to number the elements.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to transform. |
| selector | Func<TSource, Integer, TResult> | — | Gives the result for one element and its zero-based position in Source. |
Returns
| result | IEnumerable<TResult> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Select Many
FunctionOverload 1 of 4
SelectMany -> IEnumerable<TResult>
source: IEnumerable<TSource>
selector: Func<TSource, IEnumerable<TResult>>IEnumerable<TResult> SelectMany(
IEnumerable<TSource> source,
Func<TSource, IEnumerable<TResult>> selector)Turns each element into a sequence and joins all those sequences end to end into one flat sequence, for example from a list of folders to one list of all their files.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence whose elements each give a sequence. |
| selector | Func<TSource, IEnumerable<TResult>> | — | Gives the sequence for one element. |
Returns
| result | IEnumerable<TResult> |
Overload 2 of 4
SelectMany -> IEnumerable<TResult>
source: IEnumerable<TSource>
selector: Func<TSource, Integer, IEnumerable<TResult>>IEnumerable<TResult> SelectMany(
IEnumerable<TSource> source,
Func<TSource, int, IEnumerable<TResult>> selector)Turns each element, together with its position, into a sequence and joins all those sequences end to end into one flat sequence.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence whose elements each give a sequence. |
| selector | Func<TSource, Integer, IEnumerable<TResult>> | — | Gives the sequence for one element and its zero-based position in Source. |
Returns
| result | IEnumerable<TResult> |
Overload 3 of 4
SelectMany -> IEnumerable<TResult>
source: IEnumerable<TSource>
collectionSelector: Func<TSource, IEnumerable<TCollection>>
resultSelector: Func<TSource, TCollection, TResult>IEnumerable<TResult> SelectMany(
IEnumerable<TSource> source,
Func<TSource, IEnumerable<TCollection>> collectionSelector,
Func<TSource, TCollection, TResult> resultSelector)Flattens a sequence of sequences while keeping track of where each inner element came from: every inner element is combined with its source element by Result Selector, for example into (folder, file) pairs.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence whose elements each give a sequence. |
| collectionSelector | Func<TSource, IEnumerable<TCollection>> | — | Gives the inner sequence for one element. |
| resultSelector | Func<TSource, TCollection, TResult> | — | Combines a source element with one of its inner elements into a result. |
Returns
| result | IEnumerable<TResult> |
Overload 4 of 4
SelectMany -> IEnumerable<TResult>
source: IEnumerable<TSource>
collectionSelector: Func<TSource, Integer, IEnumerable<TCollection>>
resultSelector: Func<TSource, TCollection, TResult>IEnumerable<TResult> SelectMany(
IEnumerable<TSource> source,
Func<TSource, int, IEnumerable<TCollection>> collectionSelector,
Func<TSource, TCollection, TResult> resultSelector)Flattens a sequence of sequences while keeping track of where each inner element came from; like the other overload, but Collection Selector also receives each source element's position.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence whose elements each give a sequence. |
| collectionSelector | Func<TSource, Integer, IEnumerable<TCollection>> | — | Gives the inner sequence for one element and its zero-based position in Source. |
| resultSelector | Func<TSource, TCollection, TResult> | — | Combines a source element with one of its inner elements into a result. |
Returns
| result | IEnumerable<TResult> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Single
FunctionOverload 1 of 2
Single(source: IEnumerable<TSource>) -> TSource
TSource Single(IEnumerable<TSource> source)
The one and only element, for when having exactly one is an expectation worth checking. Throws System.InvalidOperationException when the sequence is empty or has more than one element.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence expected to hold exactly one element. |
Returns
| Result | TSource |
Overload 2 of 2
Single -> TSource
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>TSource Single(
IEnumerable<TSource> source,
Func<TSource, bool> predicate)The one and only element that passes a test. Throws System.InvalidOperationException when no element passes or more than one does.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to search. |
| predicate | Func<TSource, Truth> | — | The test exactly one element is expected to pass. |
Returns
| Result | TSource |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Single Or Default
FunctionOverload 1 of 4
SingleOrDefault(source: IEnumerable<TSource>) -> TSource
TSource SingleOrDefault(IEnumerable<TSource> source)
The only element, or the type's default value (null for reference and nullable types, zero for numbers) when the sequence is empty. Still throws System.InvalidOperationException when there is more than one element.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence expected to hold at most one element. |
Returns
| Result | TSource |
Overload 2 of 4
SingleOrDefault -> TSource
source: IEnumerable<TSource>
defaultValue: TSourceTSource SingleOrDefault(
IEnumerable<TSource> source,
TSource defaultValue)The only element, or Default Value when the sequence is empty. Still throws System.InvalidOperationException when there is more than one element.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence expected to hold at most one element. |
| defaultValue | TSource | — | What to give when there is no element. |
Returns
| Result | TSource |
Overload 3 of 4
SingleOrDefault -> TSource
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>TSource SingleOrDefault(
IEnumerable<TSource> source,
Func<TSource, bool> predicate)The only element that passes a test, or the type's default value (null for reference and nullable types, zero for numbers) when none does. Still throws System.InvalidOperationException when more than one passes.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to search. |
| predicate | Func<TSource, Truth> | — | The test at most one element is expected to pass. |
Returns
| Result | TSource |
Overload 4 of 4
SingleOrDefault -> TSource
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>
defaultValue: TSourceTSource SingleOrDefault(
IEnumerable<TSource> source,
Func<TSource, bool> predicate,
TSource defaultValue)The only element that passes a test, or Default Value when none does. Still throws System.InvalidOperationException when more than one passes.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to search. |
| predicate | Func<TSource, Truth> | — | The test at most one element is expected to pass. |
| defaultValue | TSource | — | What to give when no element passes. |
Returns
| Result | TSource |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Skip
FunctionThe sequence without its first Count elements. A count of zero or less gives the whole sequence, and a count at or beyond its length gives an empty one.
Skip -> IEnumerable<TSource>
source: IEnumerable<TSource>
count: IntegerIEnumerable<TSource> Skip(
IEnumerable<TSource> source,
int count)Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to skip into. |
| count | Integer | — | How many elements to leave out from the start. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Skip Last
FunctionThe sequence without its last Count elements. A count of zero or less gives the whole sequence, and a count at or beyond its length gives an empty one.
SkipLast -> IEnumerable<TSource>
source: IEnumerable<TSource>
count: IntegerIEnumerable<TSource> SkipLast(
IEnumerable<TSource> source,
int count)Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to trim. |
| count | Integer | — | How many elements to leave out from the end. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Skip While
FunctionOverload 1 of 2
SkipWhile -> IEnumerable<TSource>
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>IEnumerable<TSource> SkipWhile(
IEnumerable<TSource> source,
Func<TSource, bool> predicate)Leaves out elements from the start for as long as Predicate answers true, then gives the first element it rejected and every element after it, whether or not they would pass.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to skip into. |
| predicate | Func<TSource, Truth> | — | Answers true for each leading element to leave out. |
Returns
| result | IEnumerable<TSource> |
Overload 2 of 2
SkipWhile -> IEnumerable<TSource>
source: IEnumerable<TSource>
predicate: Func<TSource, Integer, Truth>IEnumerable<TSource> SkipWhile(
IEnumerable<TSource> source,
Func<TSource, int, bool> predicate)Leaves out elements from the start for as long as Predicate answers true, then gives the rest; the test also receives each element's position.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to skip into. |
| predicate | Func<TSource, Integer, Truth> | — | Receives an element and its zero-based position, and answers true to leave it out. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Sum
FunctionOverload 1 of 20
Sum(source: IEnumerable<Integer>) -> Integer
int Sum(IEnumerable<int> source)
The total of the numbers; an empty sequence gives 0. Throws System.OverflowException when the total does not fit in an int.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Integer> | — | The numbers to add up. |
Returns
| result | Integer |
Overload 2 of 20
Sum(source: IEnumerable<Large Integer>) -> Large Integer
long Sum(IEnumerable<long> source)
The total of the numbers; an empty sequence gives 0. Throws System.OverflowException when the total does not fit in a long.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Large Integer> | — | The numbers to add up. |
Returns
| result | Large Integer |
Overload 3 of 20
Sum(source: IEnumerable<Low Accuracy Number>) -> Low Accuracy Number
float Sum(IEnumerable<float> source)
The total of the numbers, added up in double precision and rounded to float at the end; an empty sequence gives 0, and a total too large for a float becomes infinity.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Low Accuracy Number> | — | The numbers to add up. |
Returns
| result | Low Accuracy Number |
Overload 4 of 20
Sum(source: IEnumerable<Number>) -> Number
double Sum(IEnumerable<double> source)
The total of the numbers; an empty sequence gives 0, and a total too large for a double becomes infinity.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Number> | — | The numbers to add up. |
Returns
| result | Number |
Overload 5 of 20
Sum(source: IEnumerable<High Accuracy Number>) -> High Accuracy Number
decimal Sum(IEnumerable<decimal> source)
The exact decimal total of the numbers; an empty sequence gives 0. Throws System.OverflowException when the total exceeds the decimal range.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<High Accuracy Number> | — | The numbers to add up. |
Returns
| result | High Accuracy Number |
Overload 6 of 20
Sum(source: IEnumerable<Optional Integer>) -> Optional Integer
int? Sum(IEnumerable<int?> source)
The total of the numbers that are present; nulls are skipped, and an empty or all-null sequence gives 0, never null. Throws System.OverflowException when the total does not fit in an int.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Optional Integer> | — | The numbers to add up, some of which may be missing. |
Returns
| result | Optional Integer |
Overload 7 of 20
Sum(source: IEnumerable<Optional Large Integer>) -> Optional Large Integer
long? Sum(IEnumerable<long?> source)
The total of the numbers that are present; nulls are skipped, and an empty or all-null sequence gives 0, never null. Throws System.OverflowException when the total does not fit in a long.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Optional Large Integer> | — | The numbers to add up, some of which may be missing. |
Returns
| result | Optional Large Integer |
Overload 8 of 20
Sum(source: IEnumerable<Optional Low Accuracy Number>) -> Optional Low Accuracy Number
float? Sum(IEnumerable<float?> source)
The total of the numbers that are present, added up in double precision and rounded to float at the end; nulls are skipped, and an empty or all-null sequence gives 0, never null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Optional Low Accuracy Number> | — | The numbers to add up, some of which may be missing. |
Returns
| result | Optional Low Accuracy Number |
Overload 9 of 20
Sum(source: IEnumerable<Optional Number>) -> Optional Number
double? Sum(IEnumerable<double?> source)
The total of the numbers that are present; nulls are skipped, and an empty or all-null sequence gives 0, never null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Optional Number> | — | The numbers to add up, some of which may be missing. |
Returns
| result | Optional Number |
Overload 10 of 20
Sum(source: IEnumerable<Optional High Accuracy Number>) -> Optional High Accuracy Number
decimal? Sum(IEnumerable<decimal?> source)
The exact decimal total of the numbers that are present; nulls are skipped, and an empty or all-null sequence gives 0, never null. Throws System.OverflowException when the total exceeds the decimal range.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<Optional High Accuracy Number> | — | The numbers to add up, some of which may be missing. |
Returns
| result | Optional High Accuracy Number |
Overload 11 of 20
Sum -> Integer
source: IEnumerable<TSource>
selector: Func<TSource, Integer>int Sum(
IEnumerable<TSource> source,
Func<TSource, int> selector)The total of a number worked out from each element, for example the quantities in a list of order lines; an empty sequence gives 0. Throws System.OverflowException when the total does not fit in an int.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to add up over. |
| selector | Func<TSource, Integer> | — | Gives the number for each element. |
Returns
| result | Integer |
Overload 12 of 20
Sum -> Large Integer
source: IEnumerable<TSource>
selector: Func<TSource, Large Integer>long Sum(
IEnumerable<TSource> source,
Func<TSource, long> selector)The total of a number worked out from each element; an empty sequence gives 0. Throws System.OverflowException when the total does not fit in a long.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to add up over. |
| selector | Func<TSource, Large Integer> | — | Gives the number for each element. |
Returns
| result | Large Integer |
Overload 13 of 20
Sum -> Low Accuracy Number
source: IEnumerable<TSource>
selector: Func<TSource, Low Accuracy Number>float Sum(
IEnumerable<TSource> source,
Func<TSource, float> selector)The total of a number worked out from each element, added up in double precision and rounded to float at the end; an empty sequence gives 0.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to add up over. |
| selector | Func<TSource, Low Accuracy Number> | — | Gives the number for each element. |
Returns
| result | Low Accuracy Number |
Overload 14 of 20
Sum -> Number
source: IEnumerable<TSource>
selector: Func<TSource, Number>double Sum(
IEnumerable<TSource> source,
Func<TSource, double> selector)The total of a number worked out from each element, for example the lengths of a list of segments; an empty sequence gives 0.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to add up over. |
| selector | Func<TSource, Number> | — | Gives the number for each element. |
Returns
| result | Number |
Overload 15 of 20
Sum -> High Accuracy Number
source: IEnumerable<TSource>
selector: Func<TSource, High Accuracy Number>decimal Sum(
IEnumerable<TSource> source,
Func<TSource, decimal> selector)The exact decimal total of a number worked out from each element, for example the prices in a basket; an empty sequence gives 0. Throws System.OverflowException when the total exceeds the decimal range.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to add up over. |
| selector | Func<TSource, High Accuracy Number> | — | Gives the number for each element. |
Returns
| result | High Accuracy Number |
Overload 16 of 20
Sum -> Optional Integer
source: IEnumerable<TSource>
selector: Func<TSource, Optional Integer>int? Sum(
IEnumerable<TSource> source,
Func<TSource, int?> selector)The total of a possibly missing number worked out from each element; nulls are skipped, and an empty sequence or all nulls gives 0, never null. Throws System.OverflowException when the total does not fit in an int.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to add up over. |
| selector | Func<TSource, Optional Integer> | — | Gives the number for each element, or null to skip it. |
Returns
| result | Optional Integer |
Overload 17 of 20
Sum -> Optional Large Integer
source: IEnumerable<TSource>
selector: Func<TSource, Optional Large Integer>long? Sum(
IEnumerable<TSource> source,
Func<TSource, long?> selector)The total of a possibly missing number worked out from each element; nulls are skipped, and an empty sequence or all nulls gives 0, never null. Throws System.OverflowException when the total does not fit in a long.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to add up over. |
| selector | Func<TSource, Optional Large Integer> | — | Gives the number for each element, or null to skip it. |
Returns
| result | Optional Large Integer |
Overload 18 of 20
Sum -> Optional Low Accuracy Number
source: IEnumerable<TSource>
selector: Func<TSource, Optional Low Accuracy Number>float? Sum(
IEnumerable<TSource> source,
Func<TSource, float?> selector)The total of a possibly missing number worked out from each element, added up in double precision and rounded to float at the end; nulls are skipped, and an empty sequence or all nulls gives 0, never null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to add up over. |
| selector | Func<TSource, Optional Low Accuracy Number> | — | Gives the number for each element, or null to skip it. |
Returns
| result | Optional Low Accuracy Number |
Overload 19 of 20
Sum -> Optional Number
source: IEnumerable<TSource>
selector: Func<TSource, Optional Number>double? Sum(
IEnumerable<TSource> source,
Func<TSource, double?> selector)The total of a possibly missing number worked out from each element; nulls are skipped, and an empty sequence or all nulls gives 0, never null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to add up over. |
| selector | Func<TSource, Optional Number> | — | Gives the number for each element, or null to skip it. |
Returns
| result | Optional Number |
Overload 20 of 20
Sum -> Optional High Accuracy Number
source: IEnumerable<TSource>
selector: Func<TSource, Optional High Accuracy Number>decimal? Sum(
IEnumerable<TSource> source,
Func<TSource, decimal?> selector)The exact decimal total of a possibly missing number worked out from each element; nulls are skipped, and an empty sequence or all nulls gives 0, never null. Throws System.OverflowException when the total exceeds the decimal range.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The elements to add up over. |
| selector | Func<TSource, Optional High Accuracy Number> | — | Gives the number for each element, or null to skip it. |
Returns
| result | Optional High Accuracy Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Take
FunctionThe first Count elements of the sequence: fewer when it is shorter, and none when the count is zero or less.
Take -> IEnumerable<TSource>
source: IEnumerable<TSource>
count: IntegerIEnumerable<TSource> Take(
IEnumerable<TSource> source,
int count)Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to take from. |
| count | Integer | — | How many elements to take from the start. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Take Last
FunctionThe last Count elements of the sequence: fewer when it is shorter, and none when the count is zero or less.
TakeLast -> IEnumerable<TSource>
source: IEnumerable<TSource>
count: IntegerIEnumerable<TSource> TakeLast(
IEnumerable<TSource> source,
int count)Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to take from. |
| count | Integer | — | How many elements to take from the end. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Take While
FunctionOverload 1 of 2
TakeWhile -> IEnumerable<TSource>
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>IEnumerable<TSource> TakeWhile(
IEnumerable<TSource> source,
Func<TSource, bool> predicate)Elements from the start for as long as Predicate answers true; it stops at the first element that fails, even if later elements would pass.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to take from. |
| predicate | Func<TSource, Truth> | — | Answers true for each leading element to take. |
Returns
| result | IEnumerable<TSource> |
Overload 2 of 2
TakeWhile -> IEnumerable<TSource>
source: IEnumerable<TSource>
predicate: Func<TSource, Integer, Truth>IEnumerable<TSource> TakeWhile(
IEnumerable<TSource> source,
Func<TSource, int, bool> predicate)Elements from the start for as long as Predicate answers true; the test also receives each element's position.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to take from. |
| predicate | Func<TSource, Integer, Truth> | — | Receives an element and its zero-based position, and answers true to take it. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Then By
FunctionOverload 1 of 2
ThenBy -> IOrderedEnumerable<TSource>
source: IOrderedEnumerable<TSource>
keySelector: Func<TSource, TKey>IOrderedEnumerable<TSource> ThenBy(
IOrderedEnumerable<TSource> source,
Func<TSource, TKey> keySelector)Refines an existing sort: elements that tie on the earlier keys are put in ascending order of this further key, for example surname then first name. The input must come from an OrderBy, OrderByDescending, ThenBy or ThenByDescending node.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IOrderedEnumerable<TSource> | — | The already sorted sequence. |
| keySelector | Func<TSource, TKey> | — | Gives the tie-breaking key for each element. |
Returns
| result | IOrderedEnumerable<TSource> |
Overload 2 of 2
ThenBy -> IOrderedEnumerable<TSource>
source: IOrderedEnumerable<TSource>
keySelector: Func<TSource, TKey>
comparer: IComparer<TKey>IOrderedEnumerable<TSource> ThenBy(
IOrderedEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
IComparer<TKey> comparer)Refines an existing sort: elements that tie on the earlier keys are put in ascending order of this further key, with Comparer deciding how keys are ordered.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IOrderedEnumerable<TSource> | — | The already sorted sequence. |
| keySelector | Func<TSource, TKey> | — | Gives the tie-breaking key for each element. |
| comparer | IComparer<TKey> | — | Decides which of two keys comes first; null uses the key type's default comparison. |
Returns
| result | IOrderedEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Then By Descending
FunctionOverload 1 of 2
ThenByDescending -> IOrderedEnumerable<TSource>
source: IOrderedEnumerable<TSource>
keySelector: Func<TSource, TKey>IOrderedEnumerable<TSource> ThenByDescending(
IOrderedEnumerable<TSource> source,
Func<TSource, TKey> keySelector)Refines an existing sort: elements that tie on the earlier keys are put in descending order of this further key. The input must come from an OrderBy, OrderByDescending, ThenBy or ThenByDescending node.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IOrderedEnumerable<TSource> | — | The already sorted sequence. |
| keySelector | Func<TSource, TKey> | — | Gives the tie-breaking key for each element. |
Returns
| result | IOrderedEnumerable<TSource> |
Overload 2 of 2
ThenByDescending -> IOrderedEnumerable<TSource>
source: IOrderedEnumerable<TSource>
keySelector: Func<TSource, TKey>
comparer: IComparer<TKey>IOrderedEnumerable<TSource> ThenByDescending(
IOrderedEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
IComparer<TKey> comparer)Refines an existing sort: elements that tie on the earlier keys are put in descending order of this further key, with Comparer deciding how keys are ordered.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IOrderedEnumerable<TSource> | — | The already sorted sequence. |
| keySelector | Func<TSource, TKey> | — | Gives the tie-breaking key for each element. |
| comparer | IComparer<TKey> | — | Decides which of two keys comes first; null uses the key type's default comparison. |
Returns
| result | IOrderedEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
To Array
FunctionReads the whole sequence now and copies its elements into a new array, so later steps work on a fixed snapshot instead of re-running the query.
ToArray(source: IEnumerable<TSource>) -> TSource Array
TSource[] ToArray(IEnumerable<TSource> source)
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to copy. |
Returns
| result | TSource Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
To Dictionary
FunctionOverload 1 of 6
ToDictionary -> Dictionary of TKey to TSource
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>Dictionary<TKey, TSource> ToDictionary(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector)Reads the whole sequence into a new dictionary, keying each element by Key Selector. Throws System.ArgumentException when two elements give the same key and System.ArgumentNullException when a key is null; use ToLookup when keys can repeat.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to index. |
| keySelector | Func<TSource, TKey> | — | Gives the key of each element. |
Returns
| result | Dictionary of TKey to TSource |
Overload 2 of 6
ToDictionary -> Dictionary of TKey to TSource
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
comparer: IEqualityComparer<TKey>Dictionary<TKey, TSource> ToDictionary(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
IEqualityComparer<TKey> comparer)Reads the whole sequence into a new dictionary, keying each element by Key Selector, with Comparer deciding which keys are the same (the dictionary keeps using it for lookups). Throws System.ArgumentException when two elements give the same key and System.ArgumentNullException when a key is null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to index. |
| keySelector | Func<TSource, TKey> | — | Gives the key of each element. |
| comparer | IEqualityComparer<TKey> | — | Decides whether two keys are equal; null uses the default equality. |
Returns
| result | Dictionary of TKey to TSource |
Overload 3 of 6
ToDictionary -> Dictionary of TKey to TElement
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
elementSelector: Func<TSource, TElement>Dictionary<TKey, TElement> ToDictionary(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
Func<TSource, TElement> elementSelector)Reads the whole sequence into a new dictionary, with a key and a value worked out from each element, for example name to phone number. Throws System.ArgumentException when two elements give the same key and System.ArgumentNullException when a key is null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to index. |
| keySelector | Func<TSource, TKey> | — | Gives the key of each element. |
| elementSelector | Func<TSource, TElement> | — | Gives the value stored for each element. |
Returns
| result | Dictionary of TKey to TElement |
Overload 4 of 6
ToDictionary -> Dictionary of TKey to TElement
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
elementSelector: Func<TSource, TElement>
comparer: IEqualityComparer<TKey>Dictionary<TKey, TElement> ToDictionary(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
Func<TSource, TElement> elementSelector,
IEqualityComparer<TKey> comparer)Reads the whole sequence into a new dictionary, with a key and a value worked out from each element and Comparer deciding which keys are the same. Throws System.ArgumentException when two elements give the same key and System.ArgumentNullException when a key is null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to index. |
| keySelector | Func<TSource, TKey> | — | Gives the key of each element. |
| elementSelector | Func<TSource, TElement> | — | Gives the value stored for each element. |
| comparer | IEqualityComparer<TKey> | — | Decides whether two keys are equal; null uses the default equality. |
Returns
| result | Dictionary of TKey to TElement |
Overload 5 of 6
ToDictionary(source: IEnumerable<KeyValuePair<TKey, TValue>>) -> Dictionary of TKey to TValue
Dictionary<TKey, TValue> ToDictionary(IEnumerable<KeyValuePair<TKey, TValue>> source)
Reads a sequence of key-value pairs into a new dictionary. Throws System.ArgumentException when a key appears twice and System.ArgumentNullException when a key is null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<KeyValuePair<TKey, TValue>> | — | The key-value pairs to store. |
Returns
| result | Dictionary of TKey to TValue |
Overload 6 of 6
ToDictionary -> Dictionary of TKey to TValue
source: IEnumerable<KeyValuePair<TKey, TValue>>
comparer: IEqualityComparer<TKey>Dictionary<TKey, TValue> ToDictionary(
IEnumerable<KeyValuePair<TKey, TValue>> source,
IEqualityComparer<TKey> comparer)Reads a sequence of key-value pairs into a new dictionary, with Comparer deciding which keys are the same (the dictionary keeps using it for lookups). Throws System.ArgumentException when a key appears twice and System.ArgumentNullException when a key is null.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<KeyValuePair<TKey, TValue>> | — | The key-value pairs to store. |
| comparer | IEqualityComparer<TKey> | — | Decides whether two keys are equal; null uses the default equality. |
Returns
| result | Dictionary of TKey to TValue |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
To Hash Set
FunctionOverload 1 of 2
ToHashSet(source: IEnumerable<TSource>) -> Set of TSource
HashSet<TSource> ToHashSet(IEnumerable<TSource> source)
Reads the whole sequence into a new set, dropping duplicates, for fast membership tests or further set operations.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to collect. |
Returns
| result | Set of TSource |
Overload 2 of 2
ToHashSet -> Set of TSource
source: IEnumerable<TSource>
comparer: IEqualityComparer<TSource>HashSet<TSource> ToHashSet(
IEnumerable<TSource> source,
IEqualityComparer<TSource> comparer)Reads the whole sequence into a new set, with Comparer deciding which elements are duplicates (the set keeps using it for later membership tests).
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to collect. |
| comparer | IEqualityComparer<TSource> | — | Decides whether two elements are equal; null uses the default equality. |
Returns
| result | Set of TSource |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
To List
FunctionReads the whole sequence now and copies its elements into a new list, so later steps work on a fixed snapshot that can also be added to.
ToList(source: IEnumerable<TSource>) -> List of TSource
List<TSource> ToList(IEnumerable<TSource> source)
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to copy. |
Returns
| result | List of TSource |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
To Lookup
FunctionOverload 1 of 4
ToLookup -> ILookup<TKey, TSource>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>ILookup<TKey, TSource> ToLookup(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector)Reads the whole sequence now into a lookup: a fixed, read-only grouping in which each key can have many elements, for example all orders per customer. Asking it for a key that has no elements gives an empty sequence rather than an error, and null keys are allowed.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to index. |
| keySelector | Func<TSource, TKey> | — | Gives the key of each element. |
Returns
| result | ILookup<TKey, TSource> |
Overload 2 of 4
ToLookup -> ILookup<TKey, TSource>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
comparer: IEqualityComparer<TKey>ILookup<TKey, TSource> ToLookup(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
IEqualityComparer<TKey> comparer)Reads the whole sequence now into a lookup in which each key can have many elements, with Comparer deciding which keys are the same. A key with no elements gives an empty sequence.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to index. |
| keySelector | Func<TSource, TKey> | — | Gives the key of each element. |
| comparer | IEqualityComparer<TKey> | — | Decides whether two keys are equal; null uses the default equality. |
Returns
| result | ILookup<TKey, TSource> |
Overload 3 of 4
ToLookup -> ILookup<TKey, TElement>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
elementSelector: Func<TSource, TElement>ILookup<TKey, TElement> ToLookup(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
Func<TSource, TElement> elementSelector)Reads the whole sequence now into a lookup in which each key can have many values, storing only the part of each element that Element Selector picks out. A key with no values gives an empty sequence.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to index. |
| keySelector | Func<TSource, TKey> | — | Gives the key of each element. |
| elementSelector | Func<TSource, TElement> | — | Gives the value stored for each element. |
Returns
| result | ILookup<TKey, TElement> |
Overload 4 of 4
ToLookup -> ILookup<TKey, TElement>
source: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
elementSelector: Func<TSource, TElement>
comparer: IEqualityComparer<TKey>ILookup<TKey, TElement> ToLookup(
IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
Func<TSource, TElement> elementSelector,
IEqualityComparer<TKey> comparer)Reads the whole sequence now into a lookup in which each key can have many values, storing only the part of each element that Element Selector picks out, with Comparer deciding which keys are the same.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to index. |
| keySelector | Func<TSource, TKey> | — | Gives the key of each element. |
| elementSelector | Func<TSource, TElement> | — | Gives the value stored for each element. |
| comparer | IEqualityComparer<TKey> | — | Decides whether two keys are equal; null uses the default equality. |
Returns
| result | ILookup<TKey, TElement> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Union
FunctionOverload 1 of 2
Union -> IEnumerable<TSource>
first: IEnumerable<TSource>
second: IEnumerable<TSource>IEnumerable<TSource> Union(
IEnumerable<TSource> first,
IEnumerable<TSource> second)Every distinct element found in either sequence: those of First in order, then those of Second not already seen. Duplicates within either sequence are removed too.
Parameters
| name | type | default | description |
|---|---|---|---|
| first | IEnumerable<TSource> | — | The sequence whose elements come first. |
| second | IEnumerable<TSource> | — | The sequence whose new elements follow. |
Returns
| result | IEnumerable<TSource> |
Overload 2 of 2
Union -> IEnumerable<TSource>
first: IEnumerable<TSource>
second: IEnumerable<TSource>
comparer: IEqualityComparer<TSource>IEnumerable<TSource> Union(
IEnumerable<TSource> first,
IEnumerable<TSource> second,
IEqualityComparer<TSource> comparer)Every distinct element found in either sequence, with Comparer deciding which elements are the same: those of First in order, then those of Second not already seen.
Parameters
| name | type | default | description |
|---|---|---|---|
| first | IEnumerable<TSource> | — | The sequence whose elements come first. |
| second | IEnumerable<TSource> | — | The sequence whose new elements follow. |
| comparer | IEqualityComparer<TSource> | — | Decides whether two elements are equal; null uses the default equality. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Union By
FunctionOverload 1 of 2
UnionBy -> IEnumerable<TSource>
first: IEnumerable<TSource>
second: IEnumerable<TSource>
keySelector: Func<TSource, TKey>IEnumerable<TSource> UnionBy(
IEnumerable<TSource> first,
IEnumerable<TSource> second,
Func<TSource, TKey> keySelector)Merges two sequences keeping one element per key, for example one entry per ID across two lists; the first element seen with each key is kept, those of First before those of Second.
Parameters
| name | type | default | description |
|---|---|---|---|
| first | IEnumerable<TSource> | — | The sequence whose elements come first. |
| second | IEnumerable<TSource> | — | The sequence whose elements with new keys follow. |
| keySelector | Func<TSource, TKey> | — | Gives the key that decides whether two elements count as the same. |
Returns
| result | IEnumerable<TSource> |
Overload 2 of 2
UnionBy -> IEnumerable<TSource>
first: IEnumerable<TSource>
second: IEnumerable<TSource>
keySelector: Func<TSource, TKey>
comparer: IEqualityComparer<TKey>IEnumerable<TSource> UnionBy(
IEnumerable<TSource> first,
IEnumerable<TSource> second,
Func<TSource, TKey> keySelector,
IEqualityComparer<TKey> comparer)Merges two sequences keeping one element per key, with Comparer deciding which keys are the same; the first element seen with each key is kept.
Parameters
| name | type | default | description |
|---|---|---|---|
| first | IEnumerable<TSource> | — | The sequence whose elements come first. |
| second | IEnumerable<TSource> | — | The sequence whose elements with new keys follow. |
| keySelector | Func<TSource, TKey> | — | Gives the key that decides whether two elements count as the same. |
| comparer | IEqualityComparer<TKey> | — | Decides whether two keys are equal; null uses the default equality. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library
Where
FunctionOverload 1 of 2
Where -> IEnumerable<TSource>
source: IEnumerable<TSource>
predicate: Func<TSource, Truth>IEnumerable<TSource> Where(
IEnumerable<TSource> source,
Func<TSource, bool> predicate)Filters a sequence: only the elements for which Predicate answers true, in their original order.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to filter. |
| predicate | Func<TSource, Truth> | — | Answers true for each element to keep. |
Returns
| result | IEnumerable<TSource> |
Overload 2 of 2
Where -> IEnumerable<TSource>
source: IEnumerable<TSource>
predicate: Func<TSource, Integer, Truth>IEnumerable<TSource> Where(
IEnumerable<TSource> source,
Func<TSource, int, bool> predicate)Filters a sequence with a test that can also see each element's position, for example to keep every other element.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | IEnumerable<TSource> | — | The sequence to filter. |
| predicate | Func<TSource, Integer, Truth> | — | Receives an element and its zero-based position in Source, and answers true to keep it. |
Returns
| result | IEnumerable<TSource> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Enumerable Routines
- Package
- Standard Library