SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

AvalonEdit.Texeditor how to retirve an array of lines

Last post 02-27-2016 9:45 AM by luka. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-26-2016 8:48 AM

    • luka
    • Top 200 Contributor
    • Joined on 07-24-2007
    • Bovezzo,Brescia,Lombardy,Europe
    • Posts 18

    AvalonEdit.Texeditor how to retirve an array of lines

    good morning all.

    there's anyone that know how to retrive from this.TextEditor.Text an array of lines.

    e.g.:

    this is the text
    1: line one

    2: line two

    3: line

    4: l

     

    And I want to retrive an array like this:

    String[ lines =  Avalon.textEditor.GetLines;

    thanks in advance

     

  • 02-26-2016 6:24 PM In reply to

    Re: AvalonEdit.Texeditor how to retirve an array of lines

    The TextEditor has a Document property which has the information you are looking for. It has a set of Lines. To get the text for each line you will need to use the Document's GetText property using the line offset information or just passing the line.

  • 02-27-2016 9:45 AM In reply to

    • luka
    • Top 200 Contributor
    • Joined on 07-24-2007
    • Bovezzo,Brescia,Lombardy,Europe
    • Posts 18

    Re: AvalonEdit.Texeditor how to retirve an array of lines

    Ok, thanks mate.
    And do you know how I can insert a new line into text ?
    there's a property like:

    Texteditor.Document.InsertLine(String lineContent)

    or the only method is 

    TextEditor.Text += lineContent + "\\carriageReturn\\newline";

    tahnks

     

Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.