Fast string comparison
I'm looking to create a function that will compare two
strings A and B, and return True if string A is "less than" B.
Uppercase and/or lowercase should be ignored.
For example:
A B Value
--------- ------- -------
apple banana True
banana apple False
winner wins True
WiNneR winS True
right-handed left-handed False
apple apple False (equal)
My input will consist of only words that begin with only
alphanumberic characters, but may contain hyphens (-) or
apostrophes (') within the word.
Since I will be comparing a LARGE set of words, I'm
hoping for a comparison function that works as quickly
as possible.
Thanks!
|