C# 删除文本指定行或最后一行
string path = (".\\pa\\1\\PasMessage.dat"); string[] linesD = File.ReadAllLines(path, Encoding.GetEncoding("GB2312")); Array.Resize(ref linesD, linesD.Length - 1); File.WriteAllLines(path, linesD, Encoding.GetEncoding("GB2312"));
删除后 还是有个空行。
请问怎么去掉呢?