How to find the intersection of two sets in Dart

1 Answer

0 votes
void main() {
    Set st1 = {'dart', 'c', 'c++', 'java', 'php', 'python'};
    Set st2 = {'c#', 'c', 'python', 'dart'};
    
    Set st3 = st1.intersection(st2);

    print(st3);
}
 
 
 
/*
run:
 
{dart, c, python}
 
*/

 



answered Oct 10, 2022 by avibootz
...