VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/c-sharp-char-equals-method/

⇱ C# | Char.Equals() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

C# | Char.Equals() Method

Last Updated : 11 Jul, 2025
In C#, Char.Equals() is a System.Char struct method which is used to return a value by checking whether current instance is equal to a specified object or Char value. This method can be overloaded by passing different type of arguments to it.
  1. Char.Equals(Char) Method
  2. Char.Equals(Object) Method

Char.Equals(Char) Method

This method is used to returns a value by checking whether the current instance is equal to the specified Char object or not. Syntax:
public bool Equals(Char ob);
Parameter:
ob: It is the required object which is to be compared with the value of current instance.
Return Type: If the given ob parameter is equal to the value of current instance then it returns true otherwise false. The return type of this method is System.Boolean. Example:
Output:
True
False

Char.Equals(Object) Method

This method is used to returns a value by checking whether the current instance is equal to the specified object or not. Syntax:
public override bool Equals(object ob);
Parameter:
ob: It is the required object which is to be compared with the current instance or null.
Return Type: If the given ob parameter is an instance of Char and equals to the value of current instance then it returns true otherwise false. The return type of this method is System.Boolean. Example:
Comment
Article Tags:

Explore