C#中的CharEnumerator.GetType()方法
C#中的CharEnumerator.GetType()方法用于获取当前实例的类型。
语法
public Type GetType();
现在让我们看一个实现CharEnumerator.GetType()方法的示例-
示例
using System;
public class Demo {
public static void Main(){
string strNum = "john";
CharEnumerator ch = strNum.GetEnumerator();
Console.WriteLine("HashCode = "+ch.GetHashCode());
Console.WriteLine("Get the Type = "+ch.GetType());
while (ch.MoveNext())
Console.Write(ch.Current + " ");
// disposed
ch.Dispose();
// this will show an error since we disposed the object above
// Console.WriteLine(ch.Current);
}
}输出结果
这将产生以下输出-
HashCode = 1373506 Get the Type = System.CharEnumerator j o h n
热门推荐
10 古风考试祝福语 唯美简短
11 新年儿童祝福语大全 简短
12 要庆祝生日祝福语简短
13 企业老板文案祝福语简短
14 卡片朋友祝福语大全简短
15 公司年会祝福语简短最好
16 班级祝福语简短句子
17 春节祝福语大全简短搞笑
18 酒仙网红包祝福语简短