Let's say I've got a list of strings with Swedish words: banan
, ?pple
, apelsin
, druva
.
Now I want to get this list sorted (keep in mind that this is a very simplified version of the real query):
var result = from f in fruits // The list mentioned above
orderby f
select f
This will give me: apelsin
, ?pple
, banan
, druva
. However, according to the Swedish alphabet, I should get: apelsin
, banan
, druva
, ?pple
I tried changing System.Threading.Thread.CurrentThread.CurrentCulture
to sv-SE
but that didn't really seem to affect it at all. Do I have to write my own lambda function and use .OrderBy(...)
or is there something else I can do to keep the LINQ intact?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…