Set.intersection(Set, Set) Method

Definition

Calculates and returns the identical values found in two sets.

public:
 static Microsoft::Dynamics::Ax::Xpp::Set ^ intersection(Microsoft::Dynamics::Ax::Xpp::Set ^ _set1, Microsoft::Dynamics::Ax::Xpp::Set ^ _set2);
public static Microsoft.Dynamics.Ax.Xpp.Set intersection (Microsoft.Dynamics.Ax.Xpp.Set _set1, Microsoft.Dynamics.Ax.Xpp.Set _set2);
static member intersection : Microsoft.Dynamics.Ax.Xpp.Set * Microsoft.Dynamics.Ax.Xpp.Set -> Microsoft.Dynamics.Ax.Xpp.Set
Public Shared Function intersection (_set1 As Set, _set2 As Set) As Set

Parameters

_set1
Set

The second set to be compared.

_set2
Set

The second set to be compared.

Returns

Set

A set containing the elements found in both sets.

Remarks

The following example creates two sets of integers and adds some values to them. It then prints a list of the values that are that is contained in both sets.

{ 
    Set is = new Set (Types::Integer); 
    Set is2, is1 = new Set (Types::Integer); 
    ; 
    is.add(1); 
    is.add(2); 
    is.add(3); 
    is1.add(2); 
    is1.add(4); 
    is2 = Set::intersection(is, is1); 
    // Prints "{2}" because 2 is contained in both is and is2. 
    print is2.toString(); 
}

Applies to