المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : find an item in list collection to add or update



C# Programming
02-22-2011, 04:10 AM
My list collection has several items.

I would like to add/update this collection list with the value I have while looping through the collection using foreach...
How can I check if the value already exists (update it) and if it does not exist, then add it?

Do I have to have another collection or array to hold the unique values while looping through the collection list?

Thanks