本文介绍了排序-大写字母比小写字母优先的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试对包含文本的网格控制列进行排序.我有一个问题.当我按升序对所有内容进行排序时,将"AA"放在"aa"之前,将大写字母放在首位,然后将小写字母放在首位,如何将其反转?每个人都看到相同的问题还是有人解决了?它.

我希望升序排序结果为::

aa
bb
AA
Ab

etc

Hello Everyone,

I am trying to sort my grid control column which contains text. I have one issue. When i am sorting everything in ascending order it puts "AA" before "aa", it is putting the Capital letters first and then the small letters, how to reverse this? does everyone see the same problem or has anyone solved. it.

I want the ascending sort result to be of type ::

aa
bb
AA
Ab

etc

推荐答案


AA
aa
Ab
bb



C ++为此提供了语言环境...但是我从未使用过它们.我通常在使用Windows排序功能

lstrcmp函数(Win32 API) [ ^ ]

当将排序用于显示目的时,通常应根据文本语言(或OS语言)进行排序.当仅在内部使用sort时,默认的sort可能是合适的.



C++ has locale for that... but I never used them. I was generally using Windows sort functions

lstrcmp Function (Win32 API)[^]

When the sorting is used for display purpose, sort should typically be done according to text language (or OS language). When sort is only used internally, default sort might be appropriate.



这篇关于排序-大写字母比小写字母优先的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 17:10
查看更多