using Mono.TextEditor; // ... TextEditor editor = new TextEditor(); int lineCount = editor.Document.LineCount; Console.WriteLine($"This editor contains {lineCount} lines.");
using Mono.TextEditor; // ... TextEditor editor = new TextEditor(); LineSegment line = editor.Document.GetLineSegment(3); Console.WriteLine($"Line 3 contains: {line.Text}");Here, we retrieve the LineSegment object for the fourth line of the document (using zero-based indexing) and access its Text property to retrieve the actual text of the line. Package library: Mono.TextEditor.