 
 Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
CharEnumerator.GetHashCode() Method in C#
The CharEnumerator.GetHashCode() method in C# returns a hash code for the current object.
Syntax
public virtual int GetHashCode ();
Let us now see an example to implement the CharEnumerator.GetHashCode() method −
Example
using System;
public class Demo {
   public static void Main(){
      string strNum = "john";
      CharEnumerator ch = strNum.GetEnumerator();
      Console.WriteLine("HashCode = "+ch.GetHashCode());
      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);
   }
}
Output
This will produce the following output −
HashCode = 30571253 j o h n
Advertisements
                    