【C#编程】文本文件删除 Tab 符号程序代码
ice工作室吧
全部回复
仅看楼主
level 5
蝶舞聆听 楼主
int counter = 0;string line;// Read the file and display it line by line.System.IO.StreamReader file1 = new System.IO.StreamReader("e:\\tjfj.txt");// Write the string to a file.System.IO.StreamWriter file2 = new System.IO.StreamWriter("e:\\tjfjok.txt");while((line = file1.ReadLine()) != null){string line2="";int len = line.Length;int i = 0;Console.WriteLine (len);//Console.ReadLine();while (i < len){char tihuan =line[i];if(tihuan != '\t'){line2 += tihuan;}i++;}file2.WriteLine(line2);Console.WriteLine (line);//Console.WriteLine (hh);counter++;}file2.Close();file1.Close();Console.Write(counter);// Suspend the screen.Console.ReadLine();
2007年12月07日 03点12分 1
1