# ServerTextControl.Clear Method

> Clears the selected text or the character right from the current input position.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 12.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Server.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.Server.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Server.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > ServerTextControl.Clear Method
- **276 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/clear-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/clear-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/clear-method/llms-full.txt

---

### Description

Clears the selected text or the character right from the current input position.

### Syntax

```csharp
public void Clear();
```

```vbnet
Public Sub Clear()
```

### Examples

The following example clears the current document only when it contains content.

```csharp
if (textControl.Text.Length > 0)
{
    textControl.Clear();
}
```

```vbnet
If textControl.Text.Length > 0 Then
    textControl.Clear()
End If
```

---

## Nearby

- **Previous:** [ServerTextControl.Charts Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/charts-property/llms-full.txt)
- **Next:** [ServerTextControl.CommentCreated Event](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/commentcreated-event/llms-full.txt)
