ECMA-334 C# Language Specification14.9.7: String equality operators |
The predefined string equality operators are: :
bool operator ==(string x, string y); bool operator !=(string x, string y); |
Two string values are considered equal when one of the following is true:
The string equality operators compare string values rather than string references. When two separate string instances contain the exact same sequence of characters, the values of the strings are equal, but the references are different.