Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 534861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:39:23+00:00 2026-05-13T09:39:23+00:00

Is there a graceful way in C# to delete multiple lines of text from

  • 0

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.

EDIT – Additional Details
The multiline textbox in my application is disabled (i.e. it is only editable by the application itself), and every line is terminated with a “\r\n”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:39:24+00:00Added an answer on May 13, 2026 at 9:39 am

    This is an incomplete question. So assuming you are using either TextBox or RichTextBox you can use the Lines property found inTextBoxBase.

    //get all the lines out as an arry
    string[] lines = this.textBox.Lines;
    

    You can then work with this array and set it back.

      this.textBox.Lines= newLinesArray;
    

    This might not be the most elegant way, but it will remove the first line.
    EDIT: you don’t need select, just using skip will be fine

        //number of lines to remove from the beginning
        int numOfLines = 30; 
        var lines = this.textBox1.Lines;
        var newLines = lines.Skip(numOfLines);
    
        this.textBox1.Lines = newLines.ToArray();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a graceful way to set custom tab sizes/positions in a multiline textbox
I'm wondering if there is a robust and graceful way using linq2xml to query
Is there a graceful way of realizing one is at the end of an
Is there a graceful way to handle passing a list of ids as a
There is a directed graph having a single designated node called root from which
There are two intents on the receiver side which are called from the same
There is any way to set the generic type (T) of class in the
Is there a way in PHP use a HTML form to upload only the
When using the dbml autogeneration in visual studio, a stored procedure call typically ends
I am using PHP to query some data on SQL Server 2008 R2 and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.