//练习:把123转换为:壹贰叁。Dictionary<char,char> "1一 2二 3三 4四 5五 6六 7七 8八 9九" string str = "1一 2二 3三 4四 5五 6六 7七 8八 9九"; //123 一二三 Dictionary<char, char> dic = new Dictionary<char, char>(); string[] strNew = str.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < strNew.Length; i++) { //1一 strNew[i][0] strNew[i][1] dic.Add(strNew[i][0], strNew[i][1]); } Console.WriteLine("请输入阿拉伯数字"); string input = Console.ReadLine(); for (int i = 0; i < input.Length; i++) { if (dic.ContainsKey(input[i])) { Console.Write(dic[input[i]]); } else { Console.Write(input[i]); } } Console.ReadKey();