C++ string sort like a human being?

后端 未结 4 2073
灰色年华
灰色年华 2021-02-05 23:12

I would like to sort alphanumeric strings the way a human being would sort them. I.e., \"A2\" comes before \"A10\", and \"a\" certainly comes before \"Z\"! Is there any way to d

4条回答
  •  粉色の甜心
    2021-02-06 00:02

    Is there any way to do with without writing a mini-parser?

    Let someone else do that?

    I'm using this implementation: http://www.davekoelle.com/alphanum.html, I've modified it to support wchar_t, too.

提交回复
热议问题