/Dart 2

toSet method

Set<E> toSet ()

Creates a Set containing the same elements as this iterable.

The set may contain fewer elements than the iterable, if the iterable contains an element more than once, or it contains one or more elements that are equal. The order of the elements in the set is not guaranteed to be the same as for the iterable.


Set<E> toSet() => Set<E>.from(this);

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.