Description
Searches for the specified stringToFind in the calling String. The search for a match to the specified stringToFind starts at the location specified by startIndex and ends at the location specified by lengthToSearch.
Timing Precision Mode
This page describes functionality in nanosecond timing precision mode.
Click here to see the documentation for this object in millisecond timing precision mode.
Method Signature
Arguments
stringToFind
|
|
Description:
|
The string or character to find in the calling String.
|
startIndex
|
|
Description:
|
Specifies the location in the calling String at which to start looking for the specified stringToFind.
|
Valid Range:
|
startIndex ≥ 0
|
lengthToSearch
|
|
Description:
|
Specifies the number of characters to search after the startIndex in the calling String at which to stop looking for the specified stringToFind.
|
Valid Range:
|
lengthToSearch ≥ 0
|
Return Value
Returns the index of the start of the specified stringToFind in the calling String. Returns -1 if stringToFind is not found in the specified range of the calling String. If more than one instance of stringToFind occurs in the calling String, only the index of the first instance is returned.
Syntax
myVariable1 = myString1.Find(myString2, myVariable2, myVariable3);
|
This example demonstrates the use of a start index and length input for the String.Find method.
//This example demonstrates the use of a start index as well as the
//length to search
Variable myVariable = "Feb 04 2020 10:20:30.400".Find("20", 8, 6);
Report myVariable;
|
Output:
myVariable = 9.000000000
|
See also
String Object
String.Find
Parsing Dates and Times
Parsing Arbitrary String Data
Parsing Arbitrary String Data
|