Search
Searches for a scope of a paragraph object. The search results are a collection of ApiRange objects.
Syntax
expression.Search(sText, isMatchCase);
expression
- A variable that represents a ApiParagraph class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
sText | Required | string | Search string. | |
isMatchCase | Required | boolean | Case sensitive or not. |
Returns
Example
This example shows how to make search in paragraph.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is just a sample text. This text was added to the paragraph.");
let searchResults = paragraph.Search("text");
searchResults[0].SetBold(true);