行业知识
.NET from-where-select用法
2026-10-31 00:58:31
来源:互联网转载
���接上示例代码进行说明:
()1. from-where-select的用法:
int[] arr = {3, 4, 5, 6, 7, 8, 9};int[] res = (from a in arr where a > 4 && a Console.WriteLine($"item"); 2. 运行结果:
()5678
3. 以上from-where-select用法可以for用法解读:
for (int i = 0; i 4 && res[i]