且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

有人可以解释一下这段代码中发生了什么吗?

更新时间:2023-11-09 22:38:40

tolowercase用于确保比较总是比较相同的值:在计算机术语中,Hello与hello不同,因为大写和小写字符不相同,'H'与'h'不是相同的字符。



返回值表示排序顺序:0表示第二个参数最大,1表示第一个参数。如果它们都是相同的,它返回一个随机值,稍后会导致错误...
tolowercase is used to ensure that the comparison is always comparing the same values: in computer terms, "Hello" is not the same as "hello" because upper and lower case characters are not the same, 'H' is not the same characters as 'h'.

The return values indicates the sort order: 0 means the second parameter is the largest, 1 means the first is. If they are both the same, a random value it returns, and will cause bugs later on...