C# Linq

// 注意文件开头:
// using System.Linq;

int[] scores = new int[] { 97, 92, 81, 60 };

System.Collections.Generic.IEnumerable<int> scoreQuery =
    from score in scores
    where score > 80
    select score;

string logStr = "";
foreach (int i in scoreQuery) {
    logStr += (i + " ");
}

Debug.Log(logStr);
// Output: 97 92 81
原文地址:https://www.cnblogs.com/kingBook/p/15133984.html