裏口からのC#実践入門
1.6 ループする必要のないループ
using System; using System.Linq; namespace Uraguchi { public class Tenshi6 { public static void Run() { int[] array = { 1, -1, 2, -2, 3 }; Console.WriteLine(array.FirstOrDefault(c => c < 0)); } } }
Enumerable.FirstOrDefault(TSource) メソッド (IEnumerable(TSource)) (System.Linq)
1.7 冗長な非同期ループ
LinqとThread。
await, async についての動作を確認。