I wrote a function for comparing two Hashsets and returning differences but I would like that the returned array contains the names of sent Hashsets instead of "1" and "2".
Is it possible? (My research said NO!) Is there another way to to do something similar?
Here's my code:
Public Function myDiff(ByVal H1 As HashSet(Of String), ByVal H2 As HashSet(Of String))
Dim In1No2 As New list(Of String)
Dim In2No1 As New list(Of String)
In1No2.add("In 1 and not in 2")
In2No1.add("In 2 and not in 1")
For Each mVal In H1
If Not H2.Contains(mVal) Then In1No2.Add(mVal)
Next
For Each mVal In H2
If Not H1.Contains(mVal) Then In2No1.Add(mVal)
Next
Return {In1No2.toarray, In2No1.toarray}
End function