Search code examples
c#richtextboxreadline

Getting text from specific richtextbox line


I am still new to using forms and every thing that comes with it i am wanting to get all of the text from the first line in a richtextbox and nothing else with it. I have been looking into this for about 3 hours now and haven't gotten any closer to figuring it out if any one could help would be great.


Solution

  • This will work:

    string firstLine = RichTextBox.Lines[0];
    

    You could use the same logic to get any of the lines.