Hi...i am trying doing the intersection between two List. but, i tried many times still cannot get it. Hope someone can help me...

List<KeyValuePair<String, int>> L = new List<KeyValuePair<String, int>>(sItem.ToList());
                        L.Reverse();
                        L.Sort(delegate(KeyValuePair<String, int> lhs, KeyValuePair<String, int> rhs)
                        { return rhs.Value.CompareTo(lhs.Value); });
                      
                        foreach (KeyValuePair<String,int> val in L)
                        {
                            show3 += val.Key+"\r\n";
                        }
                        MessageBox.Show(show3.ToString());

                        List<KeyValuePair<String, int>> P = new List<KeyValuePair<String, int>>(itemS.ToList());
                        foreach (KeyValuePair<String, int> pair in P)
                        {
                            show4 += pair.Key+"\r\n";
                        }
                        MessageBox.Show(show4.ToString());
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.