How can I determine which string is before another if ordered alphabetically?
Examples:
is "add" before "ask"? true
is "aaaabba" before "aaac"? true
is "xeon" before "alphabet"? false
Is there something in .NET that can do this? Or does someone know of a good method to do this? Thanks in advance. I am using C#, but another language is fine for examples, or even pseudocode, or an idea, thanks.
You could use the Compare static method or CompareTo instance method:
Prints: