"Sputnik" help  
Sputnik Help
SymmetricDifference(<arrays>...)

Description

Calculates the symmetric difference of multiple arrays, meaning it returns an array containing elements that are unique to each array and not common to any other array.

Parameters

<arrays> Two or more arrays for which to calculate the symmetric difference.

Return Value

Success: Returns a new array containing elements that are unique to each array and not common to any other array.
Failure: Returns an empty array.

Remarks

The SymmetricDifference function calculates the symmetric difference of multiple arrays using the following steps:

Calculates the union of all specified arrays.
Calculates the intersection of all specified arrays.
Returns an array containing elements that are unique to each array and not common to any other array.

Make sure to read about the ->> and the =>> operators which are very often used in Linq statements.

Related

Example

Example of usage:

my $a = ["Cat", "Fox", "Dog", "Apple" => "Red", "Banana" => "Yellow"];
my $b = ["Fox", "Cat", "Horse", "Apple1" => "Green", "Banana" => "Red"];
printr $a->>SymmetricDifference($b);
// PRINTS
// Array
// (
//     [0] => Dog
//     [Apple] => Red
//     [1] => Horse
//     [Apple1] => Green
// )

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org