Given two strings and we have to compare them using String.Equals() method in C#.Net.
String.Equals() Method
It is a method of string class, which is used to compare strings and return either true if they are equal or false, if they are not equal.
Syntax:
bool str.Equals(string str);
Return values:
- True - if strings matche.
- False - if strings do not matche.
-
C# program to compare two strings using C#
Output