1
我有數組數組。假設我想統計出9箇中有多少元素等於"a"
。數組中的元素的數量等於指定值
string[][] arr = new string[3][] {
new string[]{"a","b","c"},
new string[]{"d","a","f"},
new string[]{"g","a","a"}
};
我如何使用可枚舉擴展方法(Count
,Where
等),它做什麼?
'.SelectMany(A => A)。 Count(a => a ==「a」)'? – CodeCaster