Intersection returns the intersection of two sets
(rhs StringSet)
| 45 | |
| 46 | // Intersection returns the intersection of two sets |
| 47 | func (s StringSet) Intersection(rhs StringSet) StringSet { |
| 48 | newSet := NewStringSet() |
| 49 | for elt := range s { |
| 50 | if rhs.Exist(elt) { |
| 51 | newSet.Insert(elt) |
| 52 | } |
| 53 | } |
| 54 | return newSet |
| 55 | } |
| 56 | |
| 57 | // IntersectionWithLower returns the intersection of two sets with different case of string. |
| 58 | func (s StringSet) IntersectionWithLower(rhs StringSet, toLower bool) StringSet { |