0

Possible Duplicate:
== vs. Object.Equals(object) in .NET

What is the difference between the Equals() function and the = operator in VB.NET?

I noticed that Equals() doesn't work in some cases whereas = does.

Community
  • 1
  • 1
Elmo
  • 6,409
  • 16
  • 72
  • 140
  • This is a valid question, but answers are easily found via google. – Andrew Jan 17 '12 at 17:12
  • Good answer found here http://stackoverflow.com/questions/971954/difference-between-equals-and – Kev Ritchie Jan 17 '12 at 17:14
  • http://msdn.microsoft.com/en-us/library/7h9bszxx(v=vs.71).aspx http://msdn.microsoft.com/en-us/library/336aedhh(v=vs.71).aspx These will get you started. – Andrew Hanlon Jan 17 '12 at 17:15
  • @ach Why did you delete your answer? – Elmo Jan 17 '12 at 17:28
  • @Andrew etcetera. This is not a duplicate. VB.Net is a **different language** from C#. Voting to reopen. The `=` operator is not identical to the `==` operator in all respects. For instance in VB `"" = Nothing` is True, but in C# `"" == null` is False. And in this example the VB `=` operator is giving a different answer from `.Equals`. – MarkJ Jan 17 '12 at 17:38
  • My answer was moderated and changed to a comment... Best of luck with figuring it out. The equivalence operators / functions in .net can be tricky since they are never guaranteed to refer to the same meaning of equality between object (either referential or qualitative). – Andrew Hanlon Jan 17 '12 at 19:56
  • Voted to reopen, not a duplicate as MarkJ mentioned. – Meta-Knight Jan 17 '12 at 20:43
  • The mods are really stupid. First, they don't read the question correctly then down vote the question thousands of time and finally close it. – Elmo Jan 18 '12 at 12:26

0 Answers0