retainAll method

void retainAll(
  1. Iterable<Object?> elements$1
)
override

Removes all elements of this set that are not elements in elements.

Checks for each element of elements whether there is an element in this set that is equal to it (according to this.contains), and if so, the equal element in this set is retained, and elements that are not equal to any element in elements are removed.

final characters = <String>{'A', 'B', 'C'};
characters.retainAll({'A', 'B', 'X'});
print(characters); // {A, B}

Implementation

void retainAll(dc.Iterable<dc.Object?> elements$1, ){
throw dc.UnsupportedError("retainAll not supported on PersistentHashSet", );
}