StringInString()
- Last UpdatedJul 22, 2024
- 1 minute read
Returns the position in a string of text where a specified string first occurs.
Category
String
Syntax
IntegerResult = StringInString( Text, SearchFor, StartPos, CaseSens );
Parameters
Text
The string that is searched. Actual string or a string attribute.
SearchFor
The string to be searched for. Actual string or a string attribute.
StartPos
Determines the position in the text where the search begins. Any number or an integer attribute.
CaseSens
Determines whether the search is case-sensitive.
0 = Not case-sensitive
1 = Case-sensitive
Any number or an integer attribute.
Remarks
If multiple occurrences of SearchFor are found, the location of the first is returned.
Examples
StringInString("The mixer is running", "mix", 1, 0) ' returns 5;
StringInString("Today is Thursday", "day", 1, 0) ' returns 3;
StringInString("Today is Thursday", "day", 10, 0) ' returns 15;
StringInString("Today is Veteran's Day", "Day", 1, 1) ' returns 20;
StringInString("Today is Veteran's Day", "Night", 1, 1) ' returns 0;