# SubTextPart.Name Property

> Gets or sets the name of the subtextpart. An empty string indicates that the subtextpart has no name.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 23.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.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 Server > Reference > TXTextControl > SubTextPart.Name Property
- **612 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpart/name-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpart/name-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpart/name-property/llms-full.txt

---

### Description

Gets or sets the name of the subtextpart. An empty string indicates that the subtextpart has no name.

### Syntax

```csharp
public string Name { get; set; }
```

```vbnet
Public Property Name As String
```

### Examples

The following example marks the selected customer name as a named document region by using `SubTextPart.Name`.

```csharp
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
SubTextPart subTextPart = new("CustomerName", 10);
textControl.SubTextParts.Add(subTextPart);

subTextPart.Name = "SubTextPart1";
if (!string.IsNullOrWhiteSpace(subTextPart.Name))
{
    Console.WriteLine($"Name: {subTextPart.Name}");
}
```

```vbnet
textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim subTextPart As New SubTextPart("CustomerName", 10)
textControl.SubTextParts.Add(subTextPart)

subTextPart.Name = "SubTextPart1"
If Not String.IsNullOrWhiteSpace(subTextPart.Name) Then
    Console.WriteLine($"Name: {subTextPart.Name}")
End If
```

---

## Nearby

- **Previous:** [SubTextPart.Length Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpart/length-property/llms-full.txt)
- **Next:** [SubTextPart.NestedLevel Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpart/nestedlevel-property/llms-full.txt)
