首页 > 其他 > 详细

简繁转换

时间:2016-04-15 00:24:43      阅读:205      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!