1

In C# I have a problem in my code, when i try to write

if (string == "text") return string;

it does not give correct answer but when i try to write`

if(string.Equals("text")) return string;

it gives me the correct answer. my question is what problem is here, what is the main difference between string == "something" or string.Equals("something") for string matching.

0 Answers0