• C# 按拼音/笔划 排序的简单示例(转)


    class Program
    {
    static void Main(string[] args)
    {
    string[] arr = { "趙(ZHAO)", "錢(QIAN)", "孫(SUN)", "李(LI)", "周(ZHOU)", "吳(WU)", "鄭(ZHENG)", "王(WANG)"};

    //发音 LCID:0x00000804
    CultureInfo PronoCi = new CultureInfo(2052);
    //Thread.CurrentThread.CurrentCulture = new CultureInfo("en-us");
    Array.Sort(arr);
    Console.WriteLine("按发音排序:");
    for (int i = arr.GetLowerBound(0); i <= arr.GetUpperBound(0); i++)
    Console.WriteLine("[{0}]: {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}]: {1}", i, arr.GetValue(i));

    Console.WriteLine();

    //zh-cn (拼音:简中)
    Thread.CurrentThread.CurrentCulture = new CultureInfo("zh-cn");
    Array.Sort(arr);
    Console.WriteLine("zh-cn:");
    for (int i = arr.GetLowerBound(0); i <= arr.GetUpperBound(0); i++)
    Console.WriteLine("[{0}]: {1}", i, arr.GetValue(i));

    Console.WriteLine();

    //zh-tw (笔划数:繁中)
    Thread.CurrentThread.CurrentCulture = new CultureInfo("zh-tw");
    Array.Sort(arr);
    Console.WriteLine("zh-tw:");
    for (int i = arr.GetLowerBound(0); i <= arr.GetUpperBound(0); i++)
    Console.WriteLine("[{0}]: {1}", i, arr.GetValue(i));

    Console.ReadKey();

    }
    }

    转自:http://zwkufo.blog.163.com/blog/static/25882512010712112340559/

  • 相关阅读:
    串口通信理论知识
    串口通信基础
    串口中断程序步骤及代码
    Django之CRM项目Day6-公私户转换问题解决 班主任功能
    Django之CRM项目Day5-跳转页面 跟进记录 报名记录
    Django之CRM项目Day4-编辑客户 公私户 模糊查询
    Django之CRM项目Day3-客户展示及分页
    Django的ModelForm
    Django相关面试题
    Django基础自测
  • 原文地址:https://www.cnblogs.com/Code-life/p/3728292.html
Copyright © 2020-2023  润新知