List: item already present

  • Thread starter Thread starter Luigi
  • Start date Start date
L

Luigi

Hi all,
is there a way to verify that an item in already present in a List<string>,
like:

public List<string> codeCompositionList = new List<string>();

Thanks in advance.
 
Luigi said:
is there a way to verify that an item in already present in a List<string>,
like:

public List<string> codeCompositionList = new List<string>();

if (codeCompositionList.Contains("foo"))
 
Thanks Martin,
Now a question slightly different.
In .NET 2.0 I have a list on arrays of string:

string[] contiListF3 = { "411100", "411200", "411300", "411400", "411500",
"411600", "351800", "411850", "411900", "411970" };
VoceManager.AddVoceSourceCodici(GetTreeNode(tabellaRendiconto,
Attivita.F3_LiquiditaImpegnataPerOperazioniDaRegolare), contiListF3);


string[] contiListG1 = { "362100", "362101", "351400", "362200", "362201",
"341200", "362500",
"361200", "361400", "361500", "365925", "365950",
"362400" };

string[] contiListG2 = { "367100", "367200", "367300", "366150" };
......etc...

I have to check that every string code is present only one time in *all*
arrays.

How can I solve this problem?

Thanks a lot.

Luigi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top