我正在对由文本和数字组成的字符串进行排序。 我希望排序将数字部分排序为数字,而不是字母数字。
例如我想要:abc1def, ..., abc9def, abc10def
代替:abc10def, abc1def, ..., abc9def
有谁知道这方面的算法(特别是在 c++ 中)
谢谢
最佳答案
我问 this exact question (although in Java)并被指向http://www.davekoelle.com/alphanum.html它有多种语言的算法和实现。
关于c++ - 如何在 C++ 中实现自然排序算法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/642213/