string fileAbsolutePath = @"d:\x.txt"; //你的txt文件的路径 StringBuilder txtLines = new StringBuilder();
using (StreamReader sr = new StreamReader(@fileAbsolutePath, System.Text.Encoding.Default))
{
while (!sr.EndOfStream)
{
txtLines.AppendLine(sr.ReadLine().TrimStart('a'));
}
sr.Close();
}
using (StreamWriter sw = new StreamWriter(@fileAbsolutePath, false, System.Text.Encoding.Default))
{
sw.Write(txtLines.ToString());
}
using (StreamReader sr = new StreamReader(@fileAbsolutePath, System.Text.Encoding.Default))
{
while (!sr.EndOfStream)
{
txtLines.AppendLine(sr.ReadLine().TrimStart('a'));
}
sr.Close();
}
using (StreamWriter sw = new StreamWriter(@fileAbsolutePath, false, System.Text.Encoding.Default))
{
sw.Write(txtLines.ToString());
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货