Windows Explorer sort method

前端 未结 8 1240
萌比男神i
萌比男神i 2020-12-11 00:33

I\'m looking for an algorithm that sorts strings similar to the way files (and folders) are sorted in Windows Explorer. It seems that numeric values in strings are taken int

8条回答
  •  北荒
    北荒 (楼主)
    2020-12-11 01:26

    Explorer uses the API StrCmpLogicalW() for this kind of sorting (called 'natural sort order').

    You don't need to write your own comparison function, just use the one that already exists.

    A good explanation can be found here.

提交回复
热议问题