标签: c# linq
给定var a = new byte[] { 15, 4, 7, 81, ..., 4}。只需要快速获取a[0] | a[1] | ... | a[a.Length]。
var a = new byte[] { 15, 4, 7, 81, ..., 4}
a[0] | a[1] | ... | a[a.Length]
答案 0 :(得分:4)
尝试
var a = new byte[] {15, 4, 7, 81, 4}; var result = a.Aggregate(0, (current, bt) => current | bt);