当前位置: 移动技术网 > IT编程>开发语言>.net > Asp.net中汉字转换成为拼音

Asp.net中汉字转换成为拼音

2018年08月17日  | 移动技术网IT编程  | 我要评论

八五草鱼,梵林伽晴天团队娟子,艳修少爷txt下载

1.应用场景

  • 将汉字转换为拼音(eg:"我爱你"———>"woaini")
  • 取各个汉字的首字母(eg:"我是中国人"———>"wszgr")

2.涉及到的组件

  • 组件1:toolgood.words【我实际的就是这种】
  1. 组件名称:toolgood.words
  2. nuget地址
  3. github地址【提示:500多个star】

3.关键代码

using system;
using system.collections.generic;
using system.linq;
using system.text;
using system.threading.tasks;
using toolgood.words;

namespace pinyinxiangguan
{
    class program
    {
        static void main(string[] args)
        {
            while (true)
            {

                var name = console.readline();
                if (string.isnullorempty(name))
                {
                    break;
                }
                //获取汉字的首字母
                console.writeline(wordshelper.getfirstpinyin(name));
            }

        }
    }
}

4.关键代码截图

image

5.如果有其他好的组件推荐,欢迎各位大佬补充

image

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网