2
Answers

resset the Hashset to original data

Sin Yee

Sin Yee

13y
2.2k
1
hey, i am doing the intersection now. I need to reset back my hashset, hs2 to my original data after intersect with other hashset,hs3. So that, my hs2 can continue to intersect with other dataset.

here is my code:

 for (int i = 0; i < myArray1.Count; i++)
           {
               foreach (string t in myArray1[i].ToString().Split(' '))
               {
                   ItemKey.AppendText(t);
                   hs3.Add(t);
               } 
               hs2.IntersectWith(hs3);
               foreach (string y in hs2)
               {
                   MessageBox.Show(y);
               }
               hs2.Clear();
               
               hs3.Clear();
           }  

hope someone help me...thanks ya..
Answers (2)