Share via


Set.remove(Object) Method

Definition

Removes an element from the set.

public:
 bool remove(System::Object ^ element);
public bool remove (object element);
member this.remove : obj -> bool
Public Function remove (element As Object) As Boolean

Parameters

element
Object

Returns

true if the element was found and removed; otherwise, false.

Remarks

The following example checks whether any of the values in one set, the noConfigs set, are found in a second set, the yesConfigs set. If they are found, they are removed from the yesConfigs set.

Set             noConfigs; 
Set             yesConfigs; 
ConfigId        configId; 
SetEnumerator   se; 
; 
se = noConfigs.getEnumerator(); 
while (se.moveNext()) 
{ 
    configId    = se.current(); 
    if (yesConfigs.in(configId)) 
    { 
        yesConfigs.remove(configId); 
    } 
}

Applies to