Delete a specific line in a .NET RichTextBox

后端 未结 9 1521
后悔当初
后悔当初 2021-01-19 15:08

How can I delete a specific line of text in a RichTextBox ?

9条回答
  •  情歌与酒
    2021-01-19 15:45

    int LineToDelete = 50;
    List lines = richTextBox1.Lines.ToList();
    lines.Remove(LineToDelete);
    richTextBox1.Lines = lines.ToArray();
    

提交回复
热议问题