using System; using System.Collections.Generic; using System.Linq; namespace CSharpDemo { class Program { static void Main(string[] args) { List<TestClass> MyList = new List<TestClass>(); MyList.Add(new TestClass("AAA")); MyList.Add(new TestClass("BBB")); MyList.Add(new TestClass("CCC")); var items = from n in MyList select n.Name; foreach (var item in items) { Console.WriteLine(item); } var value = string.Join(",", items); Console.WriteLine(value); Console.Write("请按任意键继续. . ."); Console.ReadKey(true); } public class TestClass { public string Name; public TestClass(string name) { Name = name; } } } }