0

Possible Duplicate:
Are string.Equals() and == operator really same?

string class provides different methods for comparsion

  1. ==
  2. string.Equals
  3. string.Compare

what is the difference between == and Equals with respect to the string class?

because Equals method is provide by the System.Object which compares the refernces of the objects

Community
  • 1
  • 1
Raghav55
  • 3,055
  • 6
  • 28
  • 38

2 Answers2

2

In case of string , though it is a reference type , both == and Equals does a value checking unlike other reference types.

Archana
  • 99
  • 13
1

Read about C# String Equals

CloudyMarble
  • 36,908
  • 70
  • 97
  • 130