How to build a list of elements in C#?
Posted on 2007-10-02
I am working with visual studio C# 2005 so I have access to the .NET framework.
I need a data structure (probably a List, but I am opened to any suggestions) in which there will be many elements (most of the time between 1 and 10). It is not necessarily ordered.
The elements have many fields. By instance it could be:
string toto = new string('firstElement');
I need to find an element in the List by using ONLY its sequenceNb NOT its string value.
I will need to remove an element no matter of its location in the List.
Which class so you suggest (List, Collection, ...)? Can you show me a code snippet?
It is not for an homework.