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

后端 未结 8 1540
不思量自难忘°
不思量自难忘° 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:40

    I asked this exact question (although in Java) and got pointed to http://www.davekoelle.com/alphanum.html which has an algorithm and implementations of it in many languages.

提交回复
热议问题