richTextBox 我如何删除指定的行数据 ,数据我是 后来在上面显示的 如下
10 .............
9 ..................
8.....................
7..................
这样的,数据超过 3行我要把 7这行数据删除了.这个语句该怎么写.谢谢了
10 .............
9 ..................
8.....................
7..................
这样的,数据超过 3行我要把 7这行数据删除了.这个语句该怎么写.谢谢了
string[] sptt ={ "\n" };
string A = richTextBox1.Text.ToString();
string[] cells = A.Split(sptt, StringSplitOptions.RemoveEmptyEntries);
int i = 0;
richTextBox1.Text = "";
foreach (string tc in cells)
{
i++;
if (i < 4)
{
richTextBox1.AppendText(tc.ToString());
richTextBox1.AppendText("\n");
}
}
string[] sNewLines=new string[sLines.Length-3];
Array.Copy(sLines,3,sNewLines,0,sNewLines.Length );
richTextBox1.Lines=sNewLines; var result=sLines.Skip(1);