I have a checklist that asks me to use string.Equals() while checking the equality of two strings. And as far as I know, both Equals() and == yield same result when operated upon strings. For example shown below,
string str1 = "Same String";
string str2 = "Same String";
Console.WriteLine(str1==str2); //True
Console.WriteLine(string.Equals(str1,str2)); //True
So, I wanted to know which is better here? Does it make any difference in the performance?
Many thanks in advance!