# Find and Replace

## Content

[C1Editor](/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.C1Editor.html) provides asynchronous APIs for searching, highlighting, and replacing text within editor content.
These APIs support scenarios such as:

* Document search
* Text highlighting
* Content replacement

The available methods include:

* [FindAndDecorateAsync](/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.C1Editor.FindAndDecorateAsync.html)
* [FindTextReplaceAsync](/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.C1Editor.FindTextReplaceAsync.html)

***

## Highlight Text

[FindAndDecorateAsync](/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.C1Editor.FindAndDecorateAsync.html) searches editor content and applies visual formatting to matched text.
The following example highlights occurrences of "Important" using a yellow background.

```auto
var count = await c1Editor1.FindAndDecorateAsync(
    "Important",
    styles: "background-color: yellow");

if (!count.HasValue || count == 0)
{
    // no matches found
}
```

![C1WinForms Editor - FindAndDecorateAsync highlighting text](https://cdn.mescius.io/document-site-files/images/c8989ae3-804c-4f29-b5ce-fe6b13c0a9e3/image-20261006.2ea424.png?width=800)

***

## Replace Text

[FindTextReplaceAsync](/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.C1Editor.FindTextReplaceAsync.html) searches editor content and replaces matched text with the specified value.
The following example replaces occurrences of `"Nikola"` with `"Nick"`.

```auto
await c1Editor1.FindTextReplaceAsync(    text: "Nikola",
    newText: "Nick");
```

| Text | Replaced Text |
| ---- | ------------- |
| ![C1WinForms Editor - Default text before using FindTextReplaceAsync](https://cdn.mescius.io/document-site-files/images/c8989ae3-804c-4f29-b5ce-fe6b13c0a9e3/image-20261006.5f3deb.png?width=400) | ![C1WinForms Editor - Default text being highlighted after using FindTextReplaceAsync](https://cdn.mescius.io/document-site-files/images/c8989ae3-804c-4f29-b5ce-fe6b13c0a9e3/image-20261006.ac69cf.png?width=400) |
