将汉字转对应的拼音

首先引用组件:        Install-Package ToolGood.Words -Version 2.3.3.2

   static void Main(string[] args)
        {
            Console.WriteLine("请输入要转换的汉字");
            string strname = Console.ReadLine();
            //获取汉字的首字母
            Console.WriteLine(WordsHelper.GetPinYin(strname));  //获得汉字全拼音
            Console.WriteLine(WordsHelper.GetFirstPinYin(strname));  //获得汉字首字母
            Console.ReadKey();
        }

Published by

风君子

独自遨游何稽首 揭天掀地慰生平

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注