How to get text of given lines ?

SyntaxEditor for Windows Forms Forum

Posted 15 years ago by Hassan
Version: 4.0.0283
Hi ! How can I get text of the a particular line?
For example I have to get the text of line no 5. What will I have to do?


[Modified at 11/16/2009 01:48 PM]

Comments (2)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA

You can convert a document position (line/col) to an offset with editor.Document.PositionToOffset(). Then use editor.Document.GetSubstring() with the offset range.

Or if you only want a single line you can do editor.Document.Lines[index].Text.

Actipro Software Support

Posted 15 years ago by Hassan
Thanks a lot.
The latest build of this product (v24.1.0) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.