ArrayList arrayList = new ArrayList();
            arrayList.Add("1");
            arrayList.Add("1");
            arrayList.Add("2");
            arrayList.Add("2");
            arrayList.Add("3");
            arrayList.Add("3");
            arrayList.Add("4");
            arrayList.Add("5");           
            arrayList.Add("4");
            arrayList.Add("5");
            //删除重复数据
            for (int i = 0; i < arrayList.Count; i++)
            {
                for (int j = i + 1; j < arrayList.Count; j++)
                {
                    if (arrayList[i].Equals(arrayList[j]))
                    {
                        arrayList.RemoveAt(j);
                        if (i > 0)
                        {
                            i--;
                        }
                    }
                }
            }

相关文章:

  • 2022-12-23
  • 2022-01-08
  • 2021-10-02
  • 2022-12-23
  • 2021-08-15
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2022-01-31
  • 2021-09-12
  • 2021-11-25
相关资源
相似解决方案