In This Article

StringTextProvider Class

Represents an ITextProvider for a plain text string.

public class StringTextProvider : ITextProvider
Inheritance:
object object
Implements:
ITextProvider

Constructors

StringTextProvider(string)

Initializes an instance of the StringTextProvider class.

public StringTextProvider(string text)
Parameter Type Description
text string

The text string.

Properties

FirstNonWhitespaceCharacterIndex

Gets the first non-whitespace character index.

public int FirstNonWhitespaceCharacterIndex { get; }

Property Value

int:

The first non-whitespace character index.

Length

Gets the total number of available text characters.

public int Length { get; }

Property Value

int:

The total number of available text characters.

Spacers

Gets the collection of intra-text spacers.

public IList<ITextSpacer> Spacers { get; }

Property Value

IList<ITextSpacer>:

The collection of intra-text spacers.

Methods

GetSubstring(int, int)

Returns a substring range of the text.

public string GetSubstring(int characterIndex, int characterCount)
Parameter Type Description
characterIndex int

The start character index.

characterCount int

The number of characters in the range.

Returns

string:

The text substring.

Translate(int, TextProviderTranslateModes)

Translates the specified character index.

public int Translate(int characterIndex, TextProviderTranslateModes modes)
Parameter Type Description
characterIndex int

The character index to translate.

modes TextProviderTranslateModes

A TextProviderTranslateModes indicating the translate modes to use.

Returns

int:

The translated character index.

Inherited Members