Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Sealed class: RT.Util.Text.OffsetToLineCol

Summary

Encapsulates a class that offers efficient conversion of a string offset into line/column number. The class is best suited for multiple lookups on a single fixed string, and is suboptimal for single lookups into many different strings. All common newline styles are supported.

Constructors

OffsetToLineCol(string input)
Constructor: precomputes certain information to enable efficient lookups.

Instance methods

int
GetColumn(int offset)
Gets the number of the column containing the character at the specified offset.
int
GetLine(int offset)
Gets the number of the line containing the character at the specified offset.
void
GetLineAndColumn(int offset, out int line, out int column)
Gets the numbers of the line and column containing the character at the specified offset.