# Selection.Length Property

> Returns the number of characters selected. If this property is zero, no text is selected and the Start property determines the current text input position.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 22.0
- **Namespace:** `TXTextControl.Web`
- **Package:** `TXTextControl.Web` (assembly `TXTextControl.Web.DocumentEditor.dll`, from nuget.org, the private NuGet feed or Text Control Offline Packages)
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.Web > Selection.Length Property
- **304 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/selection/length-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/selection/length-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/selection/length-property/llms-full.txt

---

### Description

Returns the number of characters selected. If this property is zero, no text is selected and the Start property determines the current text input position.

### Syntax

```csharp
public int Length { get; }
```

```vbnet
Public ReadOnly Property Length As Integer
```

### Examples

The following example checks `Selection.Length` before continuing the web document workflow.

```csharp
var configuredValue = selection.Length;
Console.WriteLine($"Length used by Selection: {configuredValue}");
```

```vbnet
Dim configuredValue = selection.Length
Console.WriteLine($"Length used by Selection: {configuredValue}")
```

### Limitations

Read only.

---

## Nearby

- **Previous:** [Selection Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/selection/constructor/llms-full.txt)
- **Next:** [Selection.Load Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/selection/load-method/llms-full.txt)
