FormattedText.Find
Description:
Returns a text range identifying the first occurrence of the given string within the text, starting from a given index.
Returns a text range identifying the first occurrence of the given string within the text, starting from a given index.
Remarks:
Returns an empty text range:
Returns an empty text range:
- if the given string cannot be found in the text.
- if the given start index is beyond the length of the entire text.
public TextRange Find(
string searchString,
int startIndex,
bool matchCase,
bool matchWholeWord
)
-
StringsearchStringThe text to search for.
-
Int32startIndexThe start index to search within the text.
-
BooleanmatchCaseTrue if the case must match when searching the formatted text, false to search in a case-insensitive manner.
-
BooleanmatchWholeWordTrue if the match must be a whole word when searching the formatted text, false otherwise.
-
searchString is an empty string. -or- searchString contains invalid characters such as a newline character.
-
A non-optional argument was null
-
The given value for startIndex is negative.