10 2020 档案
摘要:StreamReader和StreamWrite操作文件 using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threa
阅读全文
摘要:FileStream类读取文件,写入文件 using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tas
阅读全文
摘要:Path类 using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _
阅读全文
摘要:using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _01文件相关
阅读全文
摘要:string str ="welcome to bejing , hello china,jiyou wuhan"; Dictionary<char, int> dict = new Dictionary<char, int>(); for (int i = 0; i < str.Length; i
阅读全文
摘要:Console.WriteLine("请输入一段字符串:"); string str = Console.ReadLine(); char[] chs = new char[str.Length]; int i = 0; //将字符串转成数组; foreach (var item in str) {
阅读全文
摘要://将一个数组中的奇数放到一个集合中,再将偶数放到另一个集合中
//最终将两个集合合并为一个集合,并且奇数显示在左边 偶数显示在右边。
阅读全文
摘要:using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespac
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _03StringJoin { class Pr
阅读全文
摘要://功能:去除掉"a,b-,cde,!,q,wcdes+-976"中的",+-!",重新组成一个数字符串;如:"abcdeqwcdes976" ; //字符串分割;将"a,b-,cde,!,q,wcdes+-976";string str = "a,b-,cde,!,q,wcdes+-976";st
阅读全文
摘要:private void SavetxtData_Click(object sender, EventArgs e) { SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "(*.txt)|*.
阅读全文
摘要:#region // 1、去掉特殊符号,将字符串反转; 方法1: string str = "AB,CD+E-F+G,HI-J,K-Nansen"; string[] strArr = str.Split(new char[] { ',', '+', '-' }, StringSplitOption
阅读全文
摘要://C#字符串反转 1、手动写一个方法 string str = "ABCDEFG"; char[] chsArr = str.ToCharArray(); for (int i = 0; i < chsArr.Length /2; i++) { char temp = chsArr[i]; chs
阅读全文