C# Char Equals(Char)
Description
Char Equals(Char)
returns a value that indicates whether
this instance is equal to the specified Char object.
Syntax
Char.Equals(Char)
has the following syntax.
public bool Equals(
char obj
)
Parameters
Char.Equals(Char)
has the following parameters.
obj
- An object to compare to this instance.
Returns
Char.Equals(Char)
method returns true if the obj parameter equals the value of this instance; otherwise, false.
Example
The following code shows how to use Char.Equals(Char) method.
using System;/*from ww w . ja v a 2s . c o m*/
public class MainClass {
public static void Main(String[] argv){
char c = 'a';
char c1 = 'a';
System.Console.WriteLine(c.Equals(c1));
}
}
The code above generates the following result.