我在c#中有一个List,我在其中添加列表字段.现在添加i时必须检查条件,如果条件满足,那么我需要删除列表中添加的最后一行.这是我的示例代码..
List<> rows = new List<>();
foreach (User user in users)
{
try
{
Row row = new Row();
row.cell = new string[11];
row.cell[1] = user."";
row.cell[0] = user."";
row.cell[2] = user."";
rows.Add(row);
if (row.cell[0].Equals("Something"))
{
//here i have to write code to remove last row from the list
//row means all the last three fields
}
}
Run Code Online (Sandbox Code Playgroud)
所以我的问题是如何从c#中的列表中删除最后一行.请帮我.