简繁转换
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();
轉載于:https://www.cnblogs.com/swlq/p/5393435.html
總結
- 上一篇: 【mysql学习】疑问点记录
- 下一篇: 深入理解display属性