Returns a text range identifying the first occurrence of the given string within the text,
starting from a given index.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 26.0.4.0 (26.0.4.0)
Syntaxpublic TextRange Find(
string searchString,
int startIndex,
bool matchCase,
bool matchWholeWord
)
Public Function Find (
searchString As String,
startIndex As Integer,
matchCase As Boolean,
matchWholeWord As Boolean
) As TextRange
public:
TextRange^ Find(
String^ searchString,
int startIndex,
bool matchCase,
bool matchWholeWord
)
member Find :
searchString : string *
startIndex : int *
matchCase : bool *
matchWholeWord : bool -> TextRange
Parameters
- searchString String
-
The text to search for.
- startIndex Int32
-
The start index to search within the text.
- matchCase Boolean
-
True if the case must match when searching the formatted text, false to search in a case-insensitive manner.
- matchWholeWord Boolean
-
True if the match must be a whole word when searching the formatted text, false otherwise.
Return Value
TextRange
The text range identified.
Exceptions
Remarks
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.
The search can be case-sensitive or case-insensitive.
The search can be set to match whole words or part of words.
See Also