Reputation: 35
I have a list of custom objects List and I would like to update a specific element say 3rd element from top, How would I do that in C#?
Upvotes: 2
Views: 1912
Reputation: 190907
// Updates a property or member of the item
myList[2].myProperty = something;
// Replaces the item in the list
myList[2] = someNewItem;
Upvotes: 8