Here, i don't understand when i compare string ".doc" with string ".exe", Compare method gives -1 value and false as a return. Where it have to return True and 1 value as a return just because i set it as "==1".
When i compare string ".exe" with string ".txt" and string ".exe" it's give valid return value.
Can anyone tell me what actually happened here?
int nDocValue = string.Compare(".doc", ".exe");
Console.WriteLine(nDocValue); // Will display -1
Console.WriteLine(string.Compare(".doc", ".exe") == 1); // False
int nTxtValue = string.Compare(".txt", ".exe");
Console.WriteLine(nTxtValue); // Will display 1
Console.WriteLine(string.Compare(".txt", ".exe") == 1); // True
int nExeValue = string.Compare(".exe", ".exe");
Console.WriteLine(nExeValue); // Will display 0
Console.WriteLine(string.Compare(".exe", ".exe") == 1); // False