int a = 0; List<string> aaa = new List<string>(){ "aaa", "bbb" }; aaa.ForEach(s => a += s.Length); //等价于aaa.ForEach(new Action<string>((s) => a += s.Length));
2022-09-12 07:59:10
int a = 0; List<string> aaa = new List<string>(){ "aaa", "bbb" }; aaa.ForEach(s => a += s.Length); //等价于aaa.ForEach(new Action<string>((s) => a += s.Length));