06 2013 档案
摘要:一.IEnumerable、IEnumerable <T>接口C#中对于所有数组,集合都可以用foreach遍历,如:List<string> list=new List<string>();foreach(string str in list){ Console.WriteLine(str);}这是因为这些类都实现了IEnumerable或IEnumerable <T>接口。二.自己写的类,实现IEnumerable接口,用foreach来遍历public class Person:IEnumerable <string>{ pub
阅读全文