# TextCharCollection.Remove Method

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

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 23.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > TextCharCollection.Remove Method
- **657 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textcharcollection/remove-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textcharcollection/remove-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textcharcollection/remove-method/llms-full.txt

---

### 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

```csharp
public bool Remove(TextChar textChar);
```

```vbnet
Public Function Remove(textChar As TextChar) As Boolean
```

### Parameters

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

```csharp
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.");
    }
}
```

```vbnet
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
```

---

## Nearby

- **Previous:** [TextCharCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textcharcollection/item-property/llms-full.txt)
- **Next:** [TextEditorException Class](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/texteditorexception/llms-full.txt)
