Text

Description

sealed class Tinman.Core.Formatting.Text

Derived from

EnumerableBase<string> abstract

Represents a chunk of text and provides access to the text lines.

The IEnumerable.GetEnumerator method will iterate through the text lines, returning the result of Line for the line indices from 0 to LineCount-1.

Public / Methods

For


public static method For → (1)

text in : string

[not-null]
The text string value.

returns → Text

The created Text object.

Creates a new instance of Text.

Line


[Pure]
public method Line → (1)

index in : int32

[0..Text.LineCount-1]
The zero-based line index.

returns → string

The line of text.

Returns the index in-th line of text.

LineAt


[Pure]
public method LineAt → (1)

offset in : int32

[0..Text.Length]
The text offset.

returns → int32

The zero-based line index.

Returns the index of the text line that contains the given offset.

LineEnd


[Pure]
public method LineEnd → (1)

index in : int32

[0..Text.LineCount-1]
The zero-based line index.

returns → int32

The line end offset (exclusive).

Returns the end offset of the index in-th line.

LineLength


[Pure]
public method LineLength → (1)

index in : int32

[0..Text.LineCount-1]
The zero-based line index.

returns → int32

The line length.

Returns the length of the index in-th line.

LineStart


[Pure]
public method LineStart → (1)

index in : int32

[0..Text.LineCount-1]
The zero-based line index.

returns → int32

The line start offset (inclusive).

Returns the start offset of the index in-th line.

OffsetAt


[Pure]
public method OffsetAt → (2)

row in : int32

[0..Text.LineCount-1]
The zero-based line index.

column in : int32

[>=0]
The zero-based column index.

returns → int32

Offset of text location.

Returns the offset of the given text location.

ToArray


public method ToArray → ()

returns → string [ ]

The text line array.

Returns the text lines as an array.

ToString

2 overloads


public method ToString1 → (2)

lineNumbers in : bool

Output line numbers?

lineEnding opt : LineEnding = LineEnding.LF

The line ending to use.

returns → string

The concatenated string value.

Returns this text as a concatenated string value, using the given LineEnding.

Public / Attributes

Length


public attribute Length → (get)

value : int32

[>=0]
Length of the original text value.

Returns the length of the original text value that has been passed to For.

See also

Text.Value

LineCount


public attribute LineCount → (get)

value : int32

[>=1]
The text line count.

Returns the number of text lines in this text.

MaxLineLength


public attribute MaxLineLength → (get)

value : int32

[>=0]
The maximum line length.

Returns the maximum line length in this text.

Value


public attribute Value → (get)

value : string

[not-null]
The original text value.

Returns the original value that has been passed to For.

See also

Text.Length