使用LINQ查询int型数组
static void Main(){ int[] number={ 2,12,5,15};//数据源 IEnumberable lownums= //定义并存储查询 from n in number where n < 10 select n;foreach(var x in lownums){ //执行查询 Console.Write("{0}",x);}}
输出:
2,5
本文共 341 字,大约阅读时间需要 1 分钟。
使用LINQ查询int型数组
static void Main(){ int[] number={ 2,12,5,15};//数据源 IEnumberable lownums= //定义并存储查询 from n in number where n < 10 select n;foreach(var x in lownums){ //执行查询 Console.Write("{0}",x);}}
输出:
2,5
转载于:https://www.cnblogs.com/xiong950413/p/10180327.html