C#迭代补充
摘要:
1.迭代器的返回类型为两种:IEnumerable 、IEnumerator2.使用yield关键字选择要在foreach循环中使用的值public static IEnumerable SimpleList() //IEnumerable是返回,SimpleList是迭代器{ yield return "string 1"; yield return "string 2"; yield return "string 3";} 阅读全文
posted @ 2011-07-28 14:55 cpetco_andy 阅读(138) 评论(0) 推荐(0)
浙公网安备 33010602011771号