C# 汉字排序

转载:http://blog.csdn.net/lgx040605112/article/details/6042316
using System;
using System.Globalization;
using System.Threading;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] arr = { "3","1","2","b","c","a","BB","A","C","阿尔巴尼亚", "一刀切", "二刀切" , "三刀切"};
            //发音 LCID:0x00000804
            CultureInfo PronoCi = new CultureInfo(2052);

            Array.Sort(arr);

            Console.WriteLine("按发音排序:");
            for (int i = arr.GetLowerBound(0); i <= arr.GetUpperBound(0); i++)
                Console.WriteLine("[{0}]:/t{1}", i, arr.GetValue(i));

            Console.WriteLine();
            //笔画数 LCID:0x00020804
            CultureInfo StrokCi = new CultureInfo(133124);

            Thread.CurrentThread.CurrentCulture = StrokCi;

            Array.Sort(arr);

            Console.WriteLine("按笔划数排序:");
            for (int i = arr.GetLowerBound(0); i <= arr.GetUpperBound(0); i++)
                Console.WriteLine("[{0}]:/t{1}", i, arr.GetValue(i));
        }

    }

}




posted @ 2017-05-05 09:59  正怒月神  阅读(1319)  评论(0编辑  收藏  举报