Sin Yee

Sin Yee

  • NA
  • 145
  • 74.9k

resset the Hashset to original data

Apr 5 2011 4:59 AM
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)