C# में CharEnumerator.Reset() मेथड इंडेक्स को गणना की गई स्ट्रिंग के पहले वर्ण से तार्किक रूप से पहले की स्थिति में आरंभ करता है।
सिंटैक्स
public void Reset ();
उदाहरण
आइए CharEnumerator.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!