On Tue, 03 Aug 2004 05:41:22 GMT,
v-******@online.microsoft.com ("Peter
Huang") wrote:
Hi
SortedList are sorted by the keys. Also the keys will be sorted by the
coding value of the key character.
Sorry, I should have been more clear, my problem isn't really related to
sorting.
What I'm doing is filling a treeview with a list of names.
The tree has two levels of nodes: the first level contains the letters of
the alphabet, the second contains all names starting with the same letter.
The problem is finding out what first-level node "special" names have to be
placed in, like "Çakti" (C) and "Önder" (O).
In a sorted list they appear at the right place (as if E and É are the same
letter), that's why I referred to it.
So the question is really simple: does a function exist that you can call
to get the "base character" for a certain character, as in
x = MysteriousFunction("É")
which would return "E" in this example.
I might be able to to roll my own, based on System.Globalization.SortKey,
if I knew what the byte values in the KeyData property mean, but that seems
to be undocumented.
It looks like two characters belong to the same base character if the first
two bytes of their sortkeys are the same, so in the worst case I could scan
the alphabet for that condition, if I was certain that there are no
exceptions.