How to implement a natural sort algorithm in c++?

后端 未结 8 1523
不思量自难忘°
不思量自难忘° 2020-11-30 10:21

I\'m sorting strings that are comprised of text and numbers. I want the sort to sort the number parts as numbers, not alphanumeric.

For example I want: abc1def, ...

8条回答
  •  遥遥无期
    2020-11-30 10:45

    For those that arrive here and are already using Qt in their project, you can use the QCollator class. See this question for details.

提交回复
热议问题