C# String Equals()

The C# Equals() method is used to check whether two specified String objects have the same value or not. If both strings have same value, it return true otherwise false.

In other words, it is used to compare two strings on the basis of content.

Signature

Parameter

str: it is a string object.

Return

It returns boolean value either true or false.


C# String Equals() Method Example

Output:

True
False