Java how to sort lowercase before uppercase strings

前端 未结 6 1009
南旧
南旧 2021-01-11 15:56

I want the files to be ordered by their abs path name, but I want the lowercase to be sorted before the uppercase. Example: Let\'s say I got 4 files:

files2.         


        
6条回答
  •  情深已故
    2021-01-11 16:16

    Check the Collator class.

    You'll have to read carefully what those constants mean, but one of them should make it possible for you to put lowercase letters before the upper-case letters.

提交回复
热议问题