I have a condition in a silverlight application that compares 2 strings, for some reason when I use == it returns false while .Equals()>
==
.Equals()>
Firstly, there is a difference. For numbers
> 2 == 2.0 True > 2.Equals(2.0) False
And for strings
> string x = null; > x == null True > x.Equals(null) NullReferenceException
In both cases, == behaves more usefully than .Equals
.Equals