enum 是枚举类型 不是枚举数枚举数枚举数是循环访问其关联集合的对象。它可被视作指向集合中任何元素的可移动的指针。一个枚举数只能与一个集合关联,但一个集合可以具有多个枚举数。C# foreach 语句(Visual Basic 中的 for each)使用枚举数并隐藏操作该枚举数的复杂性。.NET Framework 提供枚举数作为循环访问一个集合的简单方法。枚举数只读取集合中的数据,无法用于修改基础集合。有些语言提供一个隐藏直接使用枚举数的复杂性的语句。C# foreach 语句、C++ for each 语句和 Visual Basic For Each 语句使用枚举数。关于枚举数一个枚 Read More
posted @ 2012-06-05 11:19
赤卫
Views(511)
Comments(0)
Diggs(0)
using System;using System.Collections;using System.Collections.Generic;using System.Text;using System.Text.RegularExpressions;using System.Security.Cryptography;using System.IO;using System.Text;namespace StringClass{ public class StringHelper { /// <summary> /// 去掉字符串中的所有空格 /// </summary&g Read More
posted @ 2012-06-05 11:05
赤卫
Views(161)
Comments(0)
Diggs(0)
IEnumerator该接口定义需要实现以下方法:Current:获取集合中的当前元素。MoveNext:将枚举数推进到集合的下一个元素。Reset: 将枚举数设置为其初始位置,该位置位于集合中第一个元素之前。实现以上方法的类也就意味着这个集合类能够被遍历访问。IEnumerableable意味着这个类能够达到上面IEnumerator的效果, 事实上也是如此,可以从这个接口定义方法中看出来:GetEnumerator: 返回一个IEnumerator类型的值IEnumerable是集合类的基础, 它解决了集合类如何遍历的问题, 所以更高级的集合类和接口都是继承IEnumerable所有能够使 Read More
posted @ 2012-06-05 11:03
赤卫
Views(257)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号