[]
C1Editor 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 searches editor content and applies visual formatting to matched text.
The following example highlights occurrences of "Important" using a yellow background.
var count = await c1Editor1.FindAndDecorateAsync(
"Important",
styles: "background-color: yellow");
if (!count.HasValue || count == 0)
{
// no matches found
}
FindTextReplaceAsync searches editor content and replaces matched text with the specified value.
The following example replaces occurrences of "Nikola" with "Nick".
await c1Editor1.FindTextReplaceAsync( text: "Nikola",
newText: "Nick");Text | Replaced Text |
|---|---|
|
|