[英]How to update a specific element from List<T> element collections?
我有一个自定义对象列表列表,我想更新一个特定的元素说从顶部的第3个元素,我将如何在C#中做到这一点?
// Updates a property or member of the item
myList[2].myProperty = something;
// Replaces the item in the list
myList[2] = someNewItem;
使用List<T>.Item
属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.