C#-এ CharEnumerator.Reset() মেথডটি ইনডেক্সকে এনামারেটেড স্ট্রিং-এর প্রথম ক্যারেক্টারের যৌক্তিকভাবে আগের পজিশনে আরম্ভ (initialize) করে।
সিনট্যাক্স
public void Reset ();
উদাহরণ
using System;
public class Demo {
public static void Main(){
string strNum = "This is it!";
CharEnumerator ch = strNum.GetEnumerator();
Console.WriteLine("HashCode = " + ch.GetHashCode());
Console.WriteLine("Get the Type = " + ch.GetType());
while (ch.MoveNext())
Console.Write(ch.Current + " ");
ch.Reset();
Console.WriteLine();
while (ch.MoveNext())
Console.Write(ch.Current);
}
}
আউটপুট
HashCode = 65311716 Get the Type = System.CharEnumerator T h i s i s i t ! This is it!