我一直在尝试在开头或结尾删除特定长度的子字符串。
不过,这是我编写的代码,但无法正常工作。
this.temp = String.Empty;
foreach (string line in this.txtBox.Lines) {
if (Envir.Operations.Begin == true)
this.temp += line.Substring(Envir.Operations.Length - 1) + Environment.NewLine;
else
this.temp += line.Substring(0, line.Length - Envir.Operations.Length) + Environment.NewLine;
}
如果您知道如何解决此问题,请您告诉我吗?
非常感谢!