如何进行排序时,优先考虑小写字母?

huangapple go评论51阅读模式
英文:

How to do collation sorting with lowercase first?

问题

预期结果

我希望排序顺序是

arthi
Anbu
suresh
Senthil
Sugumar
venila

实际结果

但是得到了以下顺序

Anbu
arthi
Senthil
Sugumar
suresh
venila

我尝试了以下选项

strength primary
caseLevel off
caseFirst lower

如何调整规则,以便获得期望的排序顺序?

提前感谢。非常感谢任何帮助。

英文:

Input

For the given list of below strings,

Senthil
Anbu
arthi
Sugumar
suresh
venila

Expected

I want the sorting order to be

arthi
Anbu
suresh
Senthil
Sugumar
venila

Actual

But getting the follow order

Anbu
arthi
Senthil
Sugumar
suresh
venila

I tried the following option

strength primary
caseLevel off
caseFirst lower

How to tailor the rules, so that i can get the desired sort order?

Thanks in advance. Any help is much appreciated.

答案1

得分: 1

追加规则:
> &a<A<b<B<c<C<d<D<e<E<f<F<g<G<h<H<i<I<j<J<k<K<l<L<m<M<n<N<o<O<p<P<q<Q<r<R<s<S<t<T<u<U<v<V<w<W<x<X<y<Y<z<Z

它有效,但可能存在更优雅的解决方案。

英文:

Append rules:
> &a<A<b<B<c<C<d<D<e<E<f<F<g<G<h<H<i<I<j<J<k<K<l<L<m<M<n<N<o<O<p<P<q<Q<r<R<s<S<t<T<u<U<v<V<w<W<x<X<y<Y<z<Z

It works. But there is probably a more elegant solution.

huangapple
  • 本文由 发表于 2023年4月20日 00:53:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/76057044.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定