Linq Where Simple 1
7/11/2010 9:40:15 PM
public void Linq1() {
int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
var lowNums =
from num in numbers
where num < 5
select num;
Console.WriteLine("Numbers < 5:");
foreach (var x in lowNums) {
Console.WriteLine(x);
}
}
SONUÇ:
Numbers < 5:
4
1
3
2
0