gpt4 book ai didi

c# - 按名称从列表中获取条目

转载 作者:太空宇宙 更新时间:2023-11-03 17:06:01 25 4
gpt4 key购买 nike

我有一个表单列表:

List<Form> xxx = new List<Form>(); 

我怎样才能知道它是否包含任何由特定名称标识的表单,例如:

xxx.Contains()

最佳答案

尝试使用FindAll函数

List<Form> xxx = new List<Form>();
int count = xxx.FindAll(x => x.Name.Equals("YourFormName")).Count();

关于c# - 按名称从列表中获取条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11012176/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com