Prakash Tripathi

Prakash Tripathi

  • 30
  • 40k
  • 6.3m

String comparison question

Feb 2 2014 1:31 PM
Can anyone explain that why Am I getting false in Line Number 5.
 
string a = "prakash";
string b = "p";
b += "rakash"; // Append to contents of 'b'
Console.WriteLine(a == b); //True
Console.WriteLine((object)a == (object)b); //False

Answers (1)