Divooka Reference

List Routines

42 nodes

On this page 42

Add

Function

Appends an element to the end of the list.

Signature
Add(list: List of T, item: T)
void Add(List<T> list, T item)

Parameters

nametypedefaultdescription
listList of T—The list to extend; null throws System.ArgumentNullException.
itemT—The element to append; null is allowed for reference types.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Add Range

Function

Appends every element of a sequence to the end of the list, keeping their order.

Signature
AddRange(list: List of T, items: IEnumerable<T>)
void AddRange(List<T> list, IEnumerable<T> items)

Parameters

nametypedefaultdescription
listList of T—The list to extend; null throws System.ArgumentNullException.
itemsIEnumerable<T>—The elements to append; null throws System.ArgumentNullException.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

As Read Only

Function

A read-only view of the list, for handing its contents on without letting the receiver change them.

Signature
AsReadOnly(list: List of T) -> ReadOnlyCollection<T>
ReadOnlyCollection<T> AsReadOnly(List<T> list)

Parameters

nametypedefaultdescription
listList of T—The list to wrap; null throws System.ArgumentNullException.

Returns

resultReadOnlyCollection<T>

Remarks

The view is not a copy: changes made to the list afterwards show through it.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Capacity

Function

How many elements the list can hold before it has to grow its storage; always at least its count.

Signature
Capacity(list: List of T) -> Integer
int Capacity(List<T> list)

Parameters

nametypedefaultdescription
listList of T—The list to inspect; null throws System.ArgumentNullException.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Clear

Function

Removes every element, leaving an empty list; its reserved capacity is kept.

Signature
Clear(list: List of T)
void Clear(List<T> list)

Parameters

nametypedefaultdescription
listList of T—The list to empty; null throws System.ArgumentNullException.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Clone

Function

A new list with the same elements in the same order, so the copy can be changed without affecting the original.

Signature
Clone(list: List of T) -> List of T
List<T> Clone(List<T> list)

Parameters

nametypedefaultdescription
listList of T—The list to copy; null throws System.ArgumentNullException.

Returns

resultList of T

Remarks

The copy is shallow: for elements that are objects, both lists refer to the same objects.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Contains

Function

Whether the list holds an element equal to the given value.

Signature
Contains(list: List of T, item: T) -> Truth
bool Contains(List<T> list, T item)

Parameters

nametypedefaultdescription
listList of T—The list to search; null throws System.ArgumentNullException.
itemT—The value to look for, compared by equality.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Convert All

Function

A new list made by passing each element through a converter, for turning a list of one type into another, such as numbers into labels.

Signature
ConvertAll -> List of TOut
    list: List of TIn
    converter: Converter<TIn, TOut>
List<TOut> ConvertAll(
    List<TIn> list,
    Converter<TIn, TOut> converter)

Parameters

nametypedefaultdescription
listList of TIn—The list to convert; it is left unchanged, and null throws System.ArgumentNullException.
converterConverter<TIn, TOut>—The function applied to each element; null throws System.ArgumentNullException.

Returns

resultList of TOut
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Copy To

Function

Overload 1 of 3

Signature
CopyTo(list: List of T, array: T Array)
void CopyTo(List<T> list, T[] array)

Copies every element of the list into an existing array, starting at the array's first slot.

Parameters

nametypedefaultdescription
listList of T—The list to copy from; null throws System.ArgumentNullException.
arrayT Array—The array to copy into; null throws System.ArgumentNullException, and one shorter than the list throws System.ArgumentException.

Overload 2 of 3

Signature
CopyTo(list: List of T, array: T Array, arrayIndex: Integer)
void CopyTo(List<T> list, T[] array, int arrayIndex)

Copies every element of the list into an existing array, starting at a given slot of the array.

Parameters

nametypedefaultdescription
listList of T—The list to copy from; null throws System.ArgumentNullException.
arrayT Array—The array to copy into; null throws System.ArgumentNullException.
arrayIndexInteger—The array position where the first element lands; too little room after it for the whole list throws System.ArgumentException.

Overload 3 of 3

Signature
CopyTo
    list: List of T
    index: Integer
    array: T Array
    arrayIndex: Integer
    count: Integer
void CopyTo(
    List<T> list,
    int index,
    T[] array,
    int arrayIndex,
    int count)

Copies a run of the list's elements into an existing array at a given slot.

Parameters

nametypedefaultdescription
listList of T—The list to copy from; null throws System.ArgumentNullException.
indexInteger—The zero-based list position of the first element to copy.
arrayT Array—The array to copy into; null throws System.ArgumentNullException.
arrayIndexInteger—The array position where the first copied element lands.
countInteger—How many elements to copy; a negative position or count throws System.ArgumentOutOfRangeException, and a run past the end of the list or of the array throws System.ArgumentException.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Count

Function

How many elements the list currently holds.

Signature
Count(list: List of T) -> Integer
int Count(List<T> list)

Parameters

nametypedefaultdescription
listList of T—The list to count; null throws System.ArgumentNullException.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Create

Function

Overload 1 of 3

Signature
Create() -> List of T
List<T> Create()

A new, empty list that you can add elements to.

Returns

resultList of T

Overload 2 of 3

Signature
Create(capacity: Integer) -> List of T
List<T> Create(int capacity)

A new, empty list with room reserved for a number of elements, which avoids repeated regrowth when you know roughly how many you will add.

Parameters

nametypedefaultdescription
capacityInteger—How many elements to reserve room for; this is not the list's length, which starts at 0. Negative throws System.ArgumentOutOfRangeException.

Returns

resultList of T

Overload 3 of 3

Signature
Create(source: IEnumerable<T>) -> List of T
List<T> Create(IEnumerable<T> source)

A new list holding the elements of an existing sequence, such as an array, in the same order.

Parameters

nametypedefaultdescription
sourceIEnumerable<T>—The elements to copy into the list; null throws System.ArgumentNullException.

Returns

resultList of T
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Ensure Capacity

Function

Makes sure the list has room for at least the given number of elements, growing its storage if it is smaller; the elements themselves are not changed.

Signature
EnsureCapacity(list: List of T, capacity: Integer) -> Integer
int EnsureCapacity(List<T> list, int capacity)

Parameters

nametypedefaultdescription
listList of T—The list to prepare; null throws System.ArgumentNullException.
capacityInteger—The minimum number of elements to have room for; negative throws System.ArgumentOutOfRangeException.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Exists

Function

Whether at least one element passes a test, for questions such as "is any value negative?".

Signature
Exists(list: List of T, match: Predicate<T>) -> Truth
bool Exists(List<T> list, Predicate<T> match)

Parameters

nametypedefaultdescription
listList of T—The list to check; null throws System.ArgumentNullException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Find

Function

The first element, from the front, that passes a test.

Signature
Find(list: List of T, match: Predicate<T>) -> T
T Find(List<T> list, Predicate<T> match)

Parameters

nametypedefaultdescription
listList of T—The list to search; null throws System.ArgumentNullException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

ResultT
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Find Index

Function

Overload 1 of 3

Signature
FindIndex(list: List of T, match: Predicate<T>) -> Integer
int FindIndex(List<T> list, Predicate<T> match)

The position of the first element that passes a test, searching from the front.

Parameters

nametypedefaultdescription
listList of T—The list to search; null throws System.ArgumentNullException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

resultInteger

Overload 2 of 3

Signature
FindIndex -> Integer
    list: List of T
    startIndex: Integer
    match: Predicate<T>
int FindIndex(List<T> list, int startIndex, Predicate<T> match)

The position of the first element passing a test, searching forwards from a given index to the end.

Parameters

nametypedefaultdescription
listList of T—The list to search; null throws System.ArgumentNullException.
startIndexInteger—The zero-based index where the search starts; below 0 or above the count throws System.ArgumentOutOfRangeException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

resultInteger

Overload 3 of 3

Signature
FindIndex -> Integer
    list: List of T
    startIndex: Integer
    count: Integer
    match: Predicate<T>
int FindIndex(
    List<T> list,
    int startIndex,
    int count,
    Predicate<T> match)

The position of the first element passing a test within a section of the list, searching forwards.

Parameters

nametypedefaultdescription
listList of T—The list to search; null throws System.ArgumentNullException.
startIndexInteger—The zero-based index where the search starts.
countInteger—How many elements to examine; a section outside the list throws System.ArgumentOutOfRangeException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Find Last

Function

The last element, searching from the back, that passes a test.

Signature
FindLast(list: List of T, match: Predicate<T>) -> T
T FindLast(List<T> list, Predicate<T> match)

Parameters

nametypedefaultdescription
listList of T—The list to search; null throws System.ArgumentNullException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

ResultT
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

First

Function

The first element of the list.

Signature
First(list: List of T) -> T
T First(List<T> list)

Parameters

nametypedefaultdescription
listList of T—The list to read; null throws System.ArgumentNullException.

Returns

ResultT
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

For Each

Function

Runs an action once for each element, front to back, for side effects such as printing or accumulating.

Signature
ForEach(list: List of T, action: Action<T>)
void ForEach(List<T> list, Action<T> action)

Parameters

nametypedefaultdescription
listList of T—The list to walk; null throws System.ArgumentNullException.
actionAction<T>—The action run on each element; null throws System.ArgumentNullException.

Remarks

The action must not change the same list (adding, removing or replacing elements); doing so throws System.InvalidOperationException.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Get

Function

The element at a position in the list, counting from 0.

Signature
Get(list: List of T, index: Integer) -> T
T Get(List<T> list, int index)

Parameters

nametypedefaultdescription
listList of T—The list to read; null throws System.ArgumentNullException.
indexInteger—The zero-based position; below 0 or not less than the count throws System.ArgumentOutOfRangeException.

Returns

ResultT
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Get Range

Function

A new list holding a run of consecutive elements copied from this one.

Signature
GetRange -> List of T
    list: List of T
    index: Integer
    count: Integer
List<T> GetRange(List<T> list, int index, int count)

Parameters

nametypedefaultdescription
listList of T—The list to copy from; null throws System.ArgumentNullException.
indexInteger—The zero-based position of the first element to copy; negative throws System.ArgumentOutOfRangeException.
countInteger—How many elements to copy; negative throws System.ArgumentOutOfRangeException, and a run past the end throws System.ArgumentException.

Returns

resultList of T

Remarks

The copy is shallow, and changing the new list does not change the original.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Index Of

Function

Overload 1 of 3

Signature
IndexOf(list: List of T, item: T) -> Integer
int IndexOf(List<T> list, T item)

The position of the first element equal to the given value, searching from the front.

Parameters

nametypedefaultdescription
listList of T—The list to search; null throws System.ArgumentNullException.
itemT—The value to look for, compared by equality.

Returns

resultInteger

Overload 2 of 3

Signature
IndexOf(list: List of T, item: T, index: Integer) -> Integer
int IndexOf(List<T> list, T item, int index)

The position of the first element equal to the given value, searching forwards from a given index to the end.

Parameters

nametypedefaultdescription
listList of T—The list to search; null throws System.ArgumentNullException.
itemT—The value to look for, compared by equality.
indexInteger—The zero-based index where the search starts; below 0 or above the count throws System.ArgumentOutOfRangeException.

Returns

resultInteger

Overload 3 of 3

Signature
IndexOf -> Integer
    list: List of T
    item: T
    index: Integer
    count: Integer
int IndexOf(List<T> list, T item, int index, int count)

The position of the first element equal to the given value within a section of the list, searching forwards.

Parameters

nametypedefaultdescription
listList of T—The list to search; null throws System.ArgumentNullException.
itemT—The value to look for, compared by equality.
indexInteger—The zero-based index where the search starts.
countInteger—How many elements to examine; a section outside the list throws System.ArgumentOutOfRangeException.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Insert

Function

Inserts an element at a position, moving the element there and everything after it one place along.

Signature
Insert(list: List of T, index: Integer, item: T)
void Insert(List<T> list, int index, T item)

Parameters

nametypedefaultdescription
listList of T—The list to change; null throws System.ArgumentNullException.
indexInteger—The zero-based position the new element takes; equal to the count appends it, and below 0 or above the count throws System.ArgumentOutOfRangeException.
itemT—The element to insert.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Insert Range

Function

Inserts every element of a sequence at a position, keeping their order and moving the existing elements from there onwards along to make room.

Signature
InsertRange
    list: List of T
    index: Integer
    items: IEnumerable<T>
void InsertRange(List<T> list, int index, IEnumerable<T> items)

Parameters

nametypedefaultdescription
listList of T—The list to change; null throws System.ArgumentNullException.
indexInteger—The zero-based position the first inserted element takes; equal to the count appends, and below 0 or above the count throws System.ArgumentOutOfRangeException.
itemsIEnumerable<T>—The elements to insert; null throws System.ArgumentNullException.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Is Empty

Function

Whether the list has no elements.

Signature
IsEmpty(list: List of T) -> Truth
bool IsEmpty(List<T> list)

Parameters

nametypedefaultdescription
listList of T—The list to check; null throws System.ArgumentNullException.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Last

Function

The last element of the list.

Signature
Last(list: List of T) -> T
T Last(List<T> list)

Parameters

nametypedefaultdescription
listList of T—The list to read; null throws System.ArgumentNullException.

Returns

ResultT
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Last Index Of

Function

The position of the last element equal to the given value, searching from the back.

Signature
LastIndexOf(list: List of T, item: T) -> Integer
int LastIndexOf(List<T> list, T item)

Parameters

nametypedefaultdescription
listList of T—The list to search; null throws System.ArgumentNullException.
itemT—The value to look for, compared by equality.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Remove

Function

Removes the first element equal to the given value, if there is one; later duplicates stay.

Signature
Remove(list: List of T, item: T) -> Truth
bool Remove(List<T> list, T item)

Parameters

nametypedefaultdescription
listList of T—The list to change; null throws System.ArgumentNullException.
itemT—The value to remove, compared by equality.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Remove All

Function

Removes every element that passes a test, for filtering a list in place.

Signature
RemoveAll(list: List of T, match: Predicate<T>) -> Integer
int RemoveAll(List<T> list, Predicate<T> match)

Parameters

nametypedefaultdescription
listList of T—The list to change; null throws System.ArgumentNullException.
matchPredicate<T>—The test applied to each element; matching elements are removed. Null throws System.ArgumentNullException.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Remove At

Function

Removes the element at a position, moving everything after it one place back.

Signature
RemoveAt(list: List of T, index: Integer)
void RemoveAt(List<T> list, int index)

Parameters

nametypedefaultdescription
listList of T—The list to change; null throws System.ArgumentNullException.
indexInteger—The zero-based position to remove; below 0 or not less than the count throws System.ArgumentOutOfRangeException.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Remove Range

Function

Removes a run of consecutive elements, moving everything after them back to close the gap.

Signature
RemoveRange(list: List of T, index: Integer, count: Integer)
void RemoveRange(List<T> list, int index, int count)

Parameters

nametypedefaultdescription
listList of T—The list to change; null throws System.ArgumentNullException.
indexInteger—The zero-based position of the first element to remove; negative throws System.ArgumentOutOfRangeException.
countInteger—How many elements to remove; negative throws System.ArgumentOutOfRangeException, and a run past the end throws System.ArgumentException.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Reverse

Function

Overload 1 of 2

Signature
Reverse(list: List of T)
void Reverse(List<T> list)

Reverses the order of all elements in place, so the last becomes first.

Parameters

nametypedefaultdescription
listList of T—The list to reverse; null throws System.ArgumentNullException.

Overload 2 of 2

Signature
Reverse(list: List of T, index: Integer, count: Integer)
void Reverse(List<T> list, int index, int count)

Reverses the order of a run of elements in place, leaving the rest of the list as it was.

Parameters

nametypedefaultdescription
listList of T—The list to change; null throws System.ArgumentNullException.
indexInteger—The zero-based position of the first element of the run; negative throws System.ArgumentOutOfRangeException.
countInteger—How many elements the run covers; negative throws System.ArgumentOutOfRangeException, and a run past the end throws System.ArgumentException.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Set

Function

Replaces the element at a position in the list with a new value.

Signature
Set(list: List of T, index: Integer, value: T)
void Set(List<T> list, int index, T value)

Parameters

nametypedefaultdescription
listList of T—The list to change; null throws System.ArgumentNullException.
indexInteger—The zero-based position to overwrite; below 0 or not less than the count throws System.ArgumentOutOfRangeException (use Add or Insert to extend the list).
valueT—The value to store.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Set Capacity

Function

Sets exactly how many elements the list has room for, to reserve space ahead of time or release unused space.

Signature
SetCapacity(list: List of T, capacity: Integer)
void SetCapacity(List<T> list, int capacity)

Parameters

nametypedefaultdescription
listList of T—The list to change; null throws System.ArgumentNullException.
capacityInteger—The new capacity; it cannot be negative or less than the list's count, either of which throws System.ArgumentOutOfRangeException.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Slice

Function

A new list holding a run of consecutive elements copied from this one; the same as Get Range, named for those used to slicing.

Signature
Slice -> List of T
    list: List of T
    start: Integer
    length: Integer
List<T> Slice(List<T> list, int start, int length)

Parameters

nametypedefaultdescription
listList of T—The list to copy from; null throws System.ArgumentNullException.
startInteger—The zero-based position of the first element to copy; negative throws System.ArgumentOutOfRangeException.
lengthInteger—How many elements to copy (not an end position); negative throws System.ArgumentOutOfRangeException, and a run past the end throws System.ArgumentException.

Returns

resultList of T

Remarks

The copy is shallow, and changing the new list does not change the original.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Sort

Function

Overload 1 of 4

Signature
Sort(list: List of T)
void Sort(List<T> list)

Sorts the list in place in ascending order: numbers smallest first, text alphabetically.

Parameters

nametypedefaultdescription
listList of T—The list to sort; null throws System.ArgumentNullException.

Remarks

The sort is not stable: elements that compare equal may change order. Elements that are not comparable throw System.InvalidOperationException.

Overload 2 of 4

Signature
Sort(list: List of T, comparer: IComparer<T>)
void Sort(List<T> list, IComparer<T> comparer)

Sorts the list in place using the given comparer.

Parameters

nametypedefaultdescription
listList of T—The list to sort; null throws System.ArgumentNullException.
comparerIComparer<T>—The ordering to sort by; null uses the elements' default ordering, which throws System.InvalidOperationException if the elements are not comparable.

Remarks

The sort is not stable: elements that compare equal may change order.

Overload 3 of 4

Signature
Sort
    list: List of T
    index: Integer
    count: Integer
    comparer: IComparer<T>
void Sort(
    List<T> list,
    int index,
    int count,
    IComparer<T> comparer)

Sorts a run of elements in place using the given comparer, leaving the rest of the list as it was.

Parameters

nametypedefaultdescription
listList of T—The list to sort; null throws System.ArgumentNullException.
indexInteger—The zero-based position of the first element of the run; negative throws System.ArgumentOutOfRangeException.
countInteger—How many elements the run covers; negative throws System.ArgumentOutOfRangeException, and a run past the end throws System.ArgumentException.
comparerIComparer<T>—The ordering to sort by; null uses the elements' default ordering.

Remarks

The sort is not stable.

Overload 4 of 4

Signature
Sort(list: List of T, comparison: Comparison<T>)
void Sort(List<T> list, Comparison<T> comparison)

Sorts the list in place using a comparison function, for orderings such as by length or descending.

Parameters

nametypedefaultdescription
listList of T—The list to sort; null throws System.ArgumentNullException.
comparisonComparison<T>—The function that orders two elements; null throws System.ArgumentNullException.

Remarks

The comparison returns a negative number when the first argument comes first, 0 when they are equal and a positive number when the second comes first. The sort is not stable.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

To Array

Function

The list's elements copied into a new array, in the same order, for nodes that take an array.

Signature
ToArray(list: List of T) -> T Array
T[] ToArray(List<T> list)

Parameters

nametypedefaultdescription
listList of T—The list to copy; null throws System.ArgumentNullException.

Returns

resultT Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Trim Excess

Function

Shrinks the list's reserved storage to fit its elements, to give memory back once a list has finished growing.

Signature
TrimExcess(list: List of T)
void TrimExcess(List<T> list)

Parameters

nametypedefaultdescription
listList of T—The list to trim; null throws System.ArgumentNullException.

Remarks

Nothing happens if the list already uses more than about 90% of its capacity, since reallocating would cost more than it saves.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

True For All

Function

Whether every element passes a test, for questions such as "are all values positive?".

Signature
TrueForAll(list: List of T, match: Predicate<T>) -> Truth
bool TrueForAll(List<T> list, Predicate<T> match)

Parameters

nametypedefaultdescription
listList of T—The list to check; null throws System.ArgumentNullException.
matchPredicate<T>—The test applied to each element; null throws System.ArgumentNullException.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Try First

Function

Reads the first element if the list has one, without throwing on an empty list.

Signature
TryFirst(list: List of T) -> (result: Truth, value: T)
bool TryFirst(List<T> list, out T value)

Parameters

nametypedefaultdescription
listList of T—The list to read; null throws System.ArgumentNullException.

Returns

resultTruth
valueT
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Try Get

Function

Reads the element at a position if there is one, without throwing when the position is out of range.

Signature
TryGet -> (result: Truth, value: T)
    list: List of T
    index: Integer
bool TryGet(List<T> list, int index, out T value)

Parameters

nametypedefaultdescription
listList of T—The list to read; null throws System.ArgumentNullException.
indexInteger—The zero-based position to read.

Returns

resultTruth
valueT
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library

Try Last

Function

Reads the last element if the list has one, without throwing on an empty list.

Signature
TryLast(list: List of T) -> (result: Truth, value: T)
bool TryLast(List<T> list, out T value)

Parameters

nametypedefaultdescription
listList of T—The list to read; null throws System.ArgumentNullException.

Returns

resultTruth
valueT
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
List Routines
Package
Standard Library