# Contents.Lines.Find Method

> Performs a search in the DocumentServer.PDF.Contents.Lines.ContentLines list using a string value, a regular expression or by performing a search in a geometric location.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 29.0
- **Namespace:** `TXTextControl.DocumentServer.PDF.Contents`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.DocumentServer.PDF > Contents.Lines.Find Method
- **1457 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/contents-lines/find-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/contents-lines/find-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/contents-lines/find-method/llms-full.txt

---

### Description

Performs a search in the [DocumentServer.PDF.Contents.Lines.ContentLines](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/contents-lines/contentlines-property/llms-full.txt) list using a string value, a regular expression or by performing a search in a geometric location.

### Syntax

#### Find(string)

Returns a list of [DocumentServer.PDF.Contents.ContentLine](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/contents-contentline/llms-full.txt) found based on a string.

```csharp
public List<ContentLine> Find(string text);
```

```vbnet
Public Function Find(text As String) As List(Of ContentLine)
```

| Parameter | Description |
|---|---|
| text | The string to search for in the document. |

#### Find(string, RegexOptions)

Returns a list of [DocumentServer.PDF.Contents.ContentLine](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/contents-contentline/llms-full.txt) objects found through a regular expression.

```csharp
public List<ContentLine> Find(string regex, RegexOptions options);
```

```vbnet
Public Function Find(regex As String, options As RegexOptions) As List(Of ContentLine)
```

| Parameter | Description |
|---|---|
| regex | The regular expression that is used in the find process. |
| options | The regular expression options. |

#### Find(PointF, float, bool)

Returns a list of [DocumentServer.PDF.Contents.ContentLine](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/contents-contentline/llms-full.txt) objects at a geometric location with a given radius.

```csharp
public List<ContentLine> Find(PointF position, float radius = 100f, bool partially = false);
```

```vbnet
Public Function Find(position As PointF, Optional radius As Single = 100F, Optional partially As Boolean = False) As List(Of ContentLine)
```

| Parameter | Description |
|---|---|
| position | The geometric location in the document to search for. |
| radius | The radius to define the search area. |
| partially | Specifies whether the lines have to be completely inside the given rectangle or just intersect with it. |

#### Find(RectangleF, bool)

Returns a list of [DocumentServer.PDF.Contents.ContentLine](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/contents-contentline/llms-full.txt) objects in a given rectangle.

```csharp
public List<ContentLine> Find(RectangleF rectangle, bool partially = false);
```

```vbnet
Public Function Find(rectangle As RectangleF, Optional partially As Boolean = False) As List(Of ContentLine)
```

| Parameter | Description |
|---|---|
| rectangle | The rectangle that is used for the find process. |
| partially | Specifies whether the lines have to be completely inside the given rectangle or just intersect with it. |

### Return Value

Returns a list of [DocumentServer.PDF.Contents.ContentLine](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/contents-contentline/llms-full.txt) objects that matches the find options.

### Examples

The following example searches for text and handles the returned position.

```csharp
var result = lines.Find("Quarterly report", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
Console.WriteLine($"Find result: {result}");
```

```vbnet
Dim result = lines.Find("Quarterly report", System.Text.RegularExpressions.RegexOptions.IgnoreCase)
Console.WriteLine($"Find result: {result}")
```

---

## Nearby

- **Previous:** [Contents.Lines.ContentLines Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/contents-lines/contentlines-property/llms-full.txt)
- **Next:** [EmbeddedFile Class](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/embeddedfile/llms-full.txt)
