while i was learning (reading Essential C# 6 5th Edition) the String.Compare()
method i read that if i have lets say 1 string text1
and 1 string text2
when comparing that i get a number:
// 0 if equal
// negative if text1 < text2
// positive if text1 > text2
so when i do this
string text1 = "Hello";
string text2 = "Hello";
int result = string.Compare(text1, text2);
Console.Write(result); // I get 0 which means equal which is correct.
But if i do:
string text1 = "Helo";
string text2 = "Hello";
int result = string.Compare(text1, text2);
Console.Write(result); // I get 1. Shouldn't i be getting -1? Doing the opposite meaning that i have text1 = "Hello" and text 2 = "Helo" produces -1 when it should produce 1 correct?
Why does that happen or am i missing (messing) something/with something?