TX Text Control .NET Server

TextCharCollection Class

Class|Introduced in 10.1
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.Core.dll
Install
dotnet add package TXTextControl.TextControl.Core.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll
Implements
ICollection, IEnumerable

Description

An instance of the TextCharCollection class contains all characters in a Text Control document or part of the document represented through objects of the type TextChar. An instance of this class can be obtained with the TextControl.TextChars, HeaderFooter.TextChars or TextFrame.TextChars property. The TextCharCollection class implements the IEnumerable and the ICollection interfaces.

Syntax

public class TextCharCollection : ICollection, IEnumerable

Examples

The following example works with text chars in the current document.

TextCharCollection textCharCollection = textControl.TextChars;
textControl.Text = "Quarterly results\nRevenue increased by 12%.";

Members

Properties

PropertyDescription
CountGets the number of elements contained in the collection.
ItemGets the character from the collection. In C# this property is the indexer for the TextCharCollection class.

Methods

MethodDescription
AddAdds a character to the document.
CopyToCopies the elements of the collection to an array, starting at a particular index.
GetEnumeratorReturns an enumerator that can be used to iterate through the collection.
GetItemGets a particular character from the collection specified through a certain geometrical position.
RemoveRemoves a character from a Text Control document. The method can also be used to remove control characters. Single control characters which are important for other formatting attributes, i.e. a table cell end character, cannot be removed through this method.