编程语言
首页 > 编程语言> > C# Linq

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

标签:C#,System,Linq,logStr,int,score,81
来源: https://www.cnblogs.com/kingBook/p/15133984.html