ArraySort
Alias:ArraySort
, SortArray
, Sort
Output:Array of T
Reorder an array or entity stream
Parameter | Type | Required | Position | Default Value | Summary |
---|---|---|---|---|---|
Array | array<T> | ✔ | 1 | The array or entity stream to sort | |
KeySelector Using | T | 2 | Default Ordering | A function that gets the key to sort by. Use this function to select an entity property that will be used for sorting. To sort by multiple properties, concatenate several keys | |
Descending | bool or SortOrder | 3 | False | Whether to sort in descending order. |
Examples​
Example 1​
SCL​
ArraySort [2, 4, 1, 3] Descending: true
Expected Output​
[4, 3, 2, 1]
Example 2​
SCL​
Sort [
('type': 'C', 'value': 1)
('type': 'A', 'value': 2)
('type': 'B', 'value': 3)
] Using: (<>['type'])
Expected Output​
[('type': "A" 'value': 2), ('type': "B" 'value': 3), ('type': "C" 'value': 1)]