C# 字典(dictionary)练习,小写数字转大写
来源:互联网 发布:淘宝网店装修模板代码 编辑:程序博客网 时间:2024/05/29 03:24
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace _10键值对集合练习{ class Program { static void Main(string[] args) { string str = "1壹 2贰 3叁 4肆 5伍 6陆 7柒 8捌 9玖 0零"; //输入小写---->大写形式 Dictionary<char, char> dic = new Dictionary<char, char>(); string[] strNew = str.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); //给dic集合添加数据 for (int i = 0; i < strNew.Length; i++) { dic.Add(strNew[i][0], strNew[i][1]); } Console.WriteLine("请输入小写,我们将转换成大写"); string input = Console.ReadLine(); //123123 乱七八糟abc 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(); } }}
阅读全文
0 0
- C# 字典(dictionary)练习,小写数字转大写
- C#数字小写转大写
- 数字小写转大写
- 数字小写转大写
- 数字小写转大写
- 数字小写转大写
- 数字小写转大写
- 小写数字金额转大写
- C#小写转大写源代码
- C#金额小写转大写
- FLEX 小写数字转大写数字~
- 小写数字转中文大写或大写金额的C#完整方案
- JAVA练习---人民币小写转大写
- 无名管道,进程练习,小写转大写
- C# 字典(dictionary)练习,日期翻译
- js小写数字转大写(正则表达式)
- php 金额小写数字转大写汉字
- js数字小写金额转中文大写
- leetcode Maximal Rectangle
- 线程
- 朴素贝叶斯算法 & 应用实例
- Java IO 经典教程 (中) (翻译自jenkov.com)
- OpenCV学习笔记(2)——播放视频
- C# 字典(dictionary)练习,小写数字转大写
- 二维码
- Retrofit源码解读(三)--RxJavaCallAdapterFactory讲解
- 洛谷2085 最小函数值
- linux操作文件目录的12个常用命令
- 工厂模式
- linux网络编程
- 51Nod 1874 字符串排序 逆序对
- 第7讲项目1-分离各位数