How to get text of given lines ?

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Hassan
Version: 4.0.0283
Avatar
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?

Regards,
Hassan

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

Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hassan,

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 14 years ago by Hassan
Avatar
Thanks a lot.
The latest build of this product (v24.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.