TX Text Control .NET Server

Remove Method

Method|Introduced in 23.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

Removes 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.

Syntax

public bool Remove(TextChar textChar);

Parameters

ParameterDescription
textChar

Specifies the character to remove.

Return Value

The return value is true, if the character could be removed. Otherwise, it is false.

Examples

The following example works with text chars in the current document by using TextCharCollection.Remove.

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

if (textCharCollection.Count > 0)
{
    TextChar textChar = textCharCollection[1];
    if (textCharCollection.Remove(textChar))
    {
        Console.WriteLine("The item was removed.");
    }
}