I need to sort a List<string> which contains Japanese alphabet.
How could I do this in C#?
I need to sort a List<string> which contains Japanese alphabet. How could I do
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is an overload
List<T>.Sort(IComparer<T> comparer). You can pass a culture specific comparer to the sort method. The following code compares using the Japanese culture settings:In this case I passed
trueas the argument to indicate that the comparison must be case insensitive. TheStringComparerhas a couple of static properties and methods to create a suitable comparer:You can find more information on this msdn page.