如何从对象数组集合中获取选定的数据 [英] How to get the selected data from object array collection

查看:189
本文介绍了如何从对象数组集合中获取选定的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何像不使用for或foreach循环的查找方法那样直接从对象数组集合中获取选定的数据?

How to get the selected data from object array collection directly like find method not using for or foreach loop ?

object[,] objectVar = new object[3,3];
objectVar[0, 0] = 0;
objectVar[0, 1] = 0;
objectVar[0, 2] = 0;
objectVar[1, 0] = 1;
objectVar[1, 1] = 1;
objectVar[1, 2] = 1;
objectVar[2, 0] = 2;
objectVar[2, 1] = 2;
objectVar[2, 2] = 2;




在此编码中3rows& 3列插入对象数组&我想将0列值的数据匹配为1而无需索引,将数据与[i,0]值&匹配.将o/p用作




in this coding 3rows & 3 columns into the object array & i want to match the data of the 0 column value as 1 without indexing, match the data with [i,0] values & take the o/p as

object[,] obj= new object[0,3];
obj[0,1]=1
obj[0,1]=1
obj[0,1]=1

推荐答案

您可以将Array.Find与谓词一起使用来搜索所需的集合.
You can use Array.Find with a predicate to search the collection you want.


这篇关于如何从对象数组集合中获取选定的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆