C, I dont get the point with your code..
I dont have any compiler right now but try these ones:
string a="mystr";
string b="mystr";
Console.WriteLine(a==b); //true
Console.WriteLine(a.Equals(b)); //true
however then try this one:
int x=5;
Console.WriteLine((Object)x == (Object)x); //false
Console.WriteLine(x.Equals(x)); //true
and finally try this one:
Object x=5;
Object y=5;
Console.WriteLine(x==y); //false
Console.WriteLine(x.Equals(y)); //true
So string camparisons with == operator is different than others.
(I couldnt test it.Let me know if any results is not same with mine)
__________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."
|