[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 810
  • Last Modified:

checking for duplicates in arraylist while adding C# windows form

i had a arraylist i want to add items to array list only if the items are not in the arraylist
so iam using the array list as follows
ArrayList  aL=new ArrayList ();
0
kranthi4uonly
Asked:
kranthi4uonly
1 Solution
 
JimBrandleyCommented:
Is this a duplicate of your previous question, or is there something different you need to do?

Jim
0
 
Daniel JungesCommented:


           if (arrayList.Contains(myObj) == false)
            {
                arrayList.Add(myObj);
            }
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now