How to get text of given lines ?

SyntaxEditor for Windows Forms Forum

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

Add Comment

Please log in to a validated account to post comments.