Returns a text range identifying the first occurrence of the given string within the text,
starting from a given index.
Namespace:
Autodesk.Revit.DB
Assembly:
RevitAPI
(in RevitAPI.dll) Version: 17.0.0.0 (17.0.484.0)
Since:
2017
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- searchString
-
Type:
System
String
The text to search for.
- startIndex
-
Type:
System
Int32
The start index to search within the text.
- matchCase
-
Type:
System
Boolean
True if the case must match when searching the formatted text, false to search in a case-insensitive manner.
- matchWholeWord
-
Type:
System
Boolean
True if the match must be a whole word when searching the formatted text, false otherwise.
Return Value
The text range identified.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.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions ArgumentException | searchString is an empty string. -or- searchString contains invalid characters such as a newline character. |
Autodesk.Revit.Exceptions ArgumentNullException | A non-optional argument was NULL |
Autodesk.Revit.Exceptions ArgumentOutOfRangeException | The given value for startIndex is negative. |