c# - Why is .Equal False when i expect it to be true? -


The first line is true, the second is false HtmlOut and the S2 StringWriter object.

  bool b = s2.ToString () == htmlOut.ToString (); Rate = htmlOut.Equals (s2);  

I hope that which is b, but why is it wrong?

The stringwriter does not override the object. Ecloss

  htmlOut.Equals (s2);  

equals:

  object.ReferenceEquals (htmlOut, s2);  

Comments

Popular posts from this blog

email - PHP mail error ... failed to open stream : permission denied -

sql server - SQL Query - Delete duplicates if more than 3 dups? -

c# 3.0 - Issue with getting 2 chars from string using indexer -