ArrayDistinct
Alias:ArrayDistinct
, Distinct
, RemoveDuplicates
Output:Array of T
Removes duplicate elements in an array or entities in an entity stream. By default, all entity properties are used to determine duplicates. This behaviour can be changed by using the KeySelector
parameter.
Parameter | Type | Required | Position | Default Value | Summary |
---|---|---|---|---|---|
Array In | array<T> | ✔ | 1 | The array to sort | |
KeySelector Using | T | 2 | The item/entity | A function that gets the key to distinct by from the variable To distinct by multiple properties, concatenate several keys | |
IgnoreCase | bool | 3 | False | Whether to ignore case when comparing strings. |
Examples​
Example 1​
SCL​
[1, 2, 2, 3, 3] | RemoveDuplicates
Expected Output​
[1, 2, 3]
Example 2​
SCL​
[('a': 1 'b': 2), ('a': 1 'b': 2), ('a': 3 'b': 4)] | ArrayDistinct
Expected Output​
[('a': 1 'b': 2), ('a': 3 'b': 4)]