How does C-sharp string.compare compare?

string.compare (strA,strB)
on the Internet, it is said that the ASCII codes of two strings are compared
strA > strB return 1
strA=strB return 0
strA < strB return-1
look up the table:
Alav 97
b > a returns 1 correct
a > A. Why does a return-1 when comparing A with A. Does
use an ASCII code?

Jan.08,2022

not by ascii, but by sort order. Sort lowercase a before uppercase.

the first parameter is-1, and the first parameter is 1

.

MSDN makes it clear that String.Compare is to calculate the relative distance between two strings
https://docs.microsoft.com/en.

. The

algorithm should be the famous Levenshtein distance
https://en.wikipedia.org/wiki.

. The code above

wikipedia can be run directly, and the result is consistent with String.Compare (take absolute value).

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b2e8-2c27d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b2e8-2c27d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?