I have two strings that i want to compare.
A
is a Silverlight user control with the property Header
.
B
is a plain System.String
.
When i compare like so:
if(A.Header == B)
I’m getting that they are not the same.
If I inspect the values in VS2010 with quick watch the values are the same. If I run GetType
on both the objects, I find they are both System.String
.
I know that i can just compare them with String.Compare
.
I though that doing ==
on strings would always compare the values. Is there something a bit weird with this Silverlight control I am using? Could anyone explain what I am missing here?
Thanks.