using System;
using System.Collections.Generic;
using System.Linq;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
int[] numbers = { 2,4,5,10,11,12,13};
IEnumerable<int> lowNums =
from n in numbers
where n < 10
select n;
foreach(var x in lowNums)
{
Console.Write("{0}, ", x);
}
}
}
}
C#LINQ
最新推荐文章于 2025-05-12 14:12:31 发布