1.方法1 public static void main(String[] args) { try { FileWriter fileWriter = new FileWriter("c:\\Result.txt"); String ss = "cName\t\cCode\t\tcreateDate\n"; ss += "dbc券\t\t111188\t\t2017-05-14\n"; ss += "zc券\t\t111199\t\t
txt 内容 中间有比如如空格,制表符(tab)在txt为空格符(Spaces).回车符.换行符,有空字符串等情况,在读取过滤中要充分考虑到 1:打开文件 var sr=new StreamReader(file, System.Text.Encoding.Default); 2:过滤每行的“\r\n” r return 回车,n next 换行符 string line = sr.ReadLine().ToString().Replace("\r\n", ""
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace 二维数组 { class Program { static void Main(string[] args) { ;//行 ;//lie FileStream fs; string path = @"C:\Documents and Settings\Administrat