# ServerTextControl.Find Method

> Finds a text string in the main text of the document.

- **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.Find Method
- **945 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/find-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/find-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/find-method/llms-full.txt

---

### Description

Finds a text string in the main text of the document.

### Syntax

#### Find(string)

Finds the specified text string in the main text of the document. The search starts at the beginning of the document.

```csharp
public int Find(string text);
```

```vbnet
Public Function Find(text As String) As Integer
```

| Parameter | Description |
|---|---|
| text | Specifies the text to search for. |

#### Find(string, int, FindOptions)

Finds the specified text string in the main text of the document using the specified find options. The search starts at the specified position.

```csharp
public int Find(string text, int start, FindOptions options);
```

```vbnet
Public Function Find(text As String, start As Integer, options As FindOptions) As Integer
```

| Parameter | Description |
|---|---|
| text | Specifies the text to search for. |
| start | Specifies the text position where the search starts, beginning with 0. If this value is -1, the search begins at the current text input position. |
| options | Specifies search options. It can be a combination of the [FindOptions](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/findoptions/enumeration/llms-full.txt) values. |

### Return Value

If the text searched for is found, the method returns the index (zero-based) of the first character of the search string. If the specified text is not found the method returns -1.

### Examples

The following example finds a revenue label, selects it, and applies bold formatting.

```csharp
textControl.Text = "Revenue: $125,000";
int position = textControl.Find("Revenue");

if (position >= 0)
{
    textControl.Select(position, "Revenue".Length);
    textControl.Selection.Bold = true;
}
```

```vbnet
textControl.Text = "Revenue: $125,000"
Dim position As Integer = textControl.Find("Revenue")

If position >= 0 Then
    textControl.Select(position, "Revenue".Length)
    textControl.Selection.Bold = True
End If
```

---

## Nearby

- **Previous:** [ServerTextControl.EntryAssembly Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/entryassembly-property/llms-full.txt)
- **Next:** [ServerTextControl.Font Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/font-property/llms-full.txt)
