select用法

 String[] arr = new[] { "1", "123" };

            IEnumerable<int> arrSelectIndex = arr.Select<String, int>((s, i) => Convert.ToInt32(s) + i);

            foreach (int i in arrSelectIndex)

            {

                Console.WriteLine(i);

            }

            IEnumerable<int> arrSelect = arr.Select<String, int>(s => Convert.ToInt32(s)).ToList();

            foreach (var s in arrSelect)

            {

                Console.WriteLine(s);

            }

你可能感兴趣的:(select)