Remove Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
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);Public Function Remove(textChar As TextChar) As BooleanParameters
| Parameter | Description |
|---|---|
| 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.");
}
}Dim textCharCollection As TextCharCollection = textControl.TextChars
textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
If textCharCollection.Count > 0 Then
Dim textChar As TextChar = textCharCollection.Item(1)
If textCharCollection.Remove(textChar) Then
Console.WriteLine("The item was removed.")
End If
End If