C#-এ CharEnumerator.ToString() পদ্ধতিটি একটি স্ট্রিং পায় যা বর্তমান বস্তুর প্রতিনিধিত্ব করে।
সিনট্যাক্স
নিচের সিনট্যাক্স-
public virtual string ToString();
উদাহরণ
আসুন এখন CharEnumerator.ToString() পদ্ধতি -
প্রয়োগ করার জন্য একটি উদাহরণ দেখি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());
Console.WriteLine("\nString representation = "+ch.ToString());
while (ch.MoveNext())
Console.Write(ch.Current + " ");
ch.Reset();
Console.WriteLine();
while (ch.MoveNext())
Console.Write(ch.Current);
}
} আউটপুট
এটি নিম্নলিখিত আউটপুট −
তৈরি করবেHashCode = 31020903 Get the Type = System.CharEnumerator String representation = System.CharEnumerator T h i s i s i t ! This is it!