悟生慧

 

C#去掉list集合中的重复数据

            List<string> conList= new List<string>();
            List<string> listII = new List<string>();
            int m = 0;
            for (int i = 0; i < conList.Count; i++)
            {
                string i_value = (string)conList[i];
                for (int j = 0; j < conList.Count; j++)
                {
                    string j_value = (string)conList[j];
                    if (i_value.cfg_Value == j_value.cfg_Value)
                    {
                        if (i != j)
                        {
                            m = j;
                            j--;
                        }
                        else
                        {
                            string con = (string)conList[i];
                            listII.Add(con);
                        }
                    }
                }
            }

 

posted on 2013-08-15 16:34  悟生慧  阅读(17498)  评论(1编辑  收藏  举报

导航