Returns a new set with items in the current set but not in the other set
(other StringSet)
| 103 | |
| 104 | // Returns a new set with items in the current set but not in the other set |
| 105 | func (set StringSet) Difference(other StringSet) StringSet { |
| 106 | differencedSet := NewStringSet() |
| 107 | for elem := range set { |
| 108 | if !other.Contains(elem) { |
| 109 | differencedSet.Add(elem) |
| 110 | } |
| 111 | } |
| 112 | return differencedSet |
| 113 | } |
| 114 | |
| 115 | // Returns a new set with items in the current set or the other set but not in both. |
| 116 | func (set StringSet) SymmetricDifference(other StringSet) StringSet { |