码迷,mamicode.com
首页 > 其他好文 > 详细

简繁转换

时间:2016-04-15 00:26:39      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:


private const string Jian = "阿";
private const string Fan = "阿";
static void Main(string[] args)
{

//将用户输入的简体字转换成繁体字
Hashtable ht = new Hashtable();
for (int i = 0; i < Jian.Length;i++ )
{
ht.Add(Jian[i],Fan[i]);

}

Console.WriteLine("请随便输入");
string input = Console.ReadLine();
//遍历用户输入的字符串将每个字符都转换成繁体字
for (int i = 0; i < input.Length;i++ )
{
if (ht.ContainsKey(input[i]))
{
Console.WriteLine(ht[input[i]]);
}
else
{
Console.WriteLine(input[i]);

}

}
Console.ReadKey();

简繁转换

标签:

原文地址:http://www.cnblogs.com/swlq/p/5393435.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!