Delete Lines From Beginning of Multiline Textbox in C#

后端 未结 5 671
粉色の甜心
粉色の甜心 2021-01-02 01:49

Is there a graceful way in C# to delete multiple lines of text from the beginning of a multiline textbox? I am using Microsoft Visual C# 2008 Express Edition.

5条回答
  •  长情又很酷
    2021-01-02 02:03

    if (txtLog.Lines.Length > maxNumberLines)
    {
        txtLog.Lines = txtLog.Lines.Skip(txtLog.Lines.Length - maxNumberLines).ToArray();
    }
    

提交回复
热议问题