I have 2 characters that I'm trying to compare using Globalization.SortKey
and just out of the box it is sorting almost exactly how I would like it to with 'a' being first and 'z' being last (then followed by special characters. The one problem is it has "Aa" after "a", is there anyway to switch the order so that the capital letters are put at the top of each letter instead of the bottom?
public static bool ShouldSecondComeFirst( string first, string second ){
CompareInfo = new CultureInfo( "en-US", false ).CompareInfo;
SortKey sortF = compInfo.GetSortKey( f );
SortKey sortS = compInfo.GetSortKey( s );
if( SortKey.Compare( sortF, sortS) == 1 )
return true;
return false;
}
The list output looks something like this
a.txt
Aa.txt
b.txt
Z.txt
but I need it to be
Aa.txt
a.txt
b.txt
Z.txt