好一个文本文件,所以我有示例内容如下管理在C#
line1with some random stuff here
line 2 with something very completely different
line3 has some other neat stuff
line4 is the last line in the textfile
一个文本文件,我需要得到该文本文件,删除一行,并保留文件的其余部分完好无损。所以如果我想删除第2行,id想要这样的结果:
line1with some random stuff here
line3 has some other neat stuff
line4 is the last line in the textfile
通知我不想在行之间留下任何空格。
〜代码示例请!即使这是不可能的,任何帮助将不胜感激! :)
删除一行,并将文件保留为机智:这是矛盾的 – 2009-11-02 03:04:20
您真的无法弄清楚他的意思而不玩弄语义吗? – Tinister 2009-11-02 03:10:03
好吧,我看不出原来的文件是否被留下,而另一个创建的文件或修改后的文件替换了第一个。 – 2009-11-02 03:22:38