...
Scroll tablelayout | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Returns the zero based index of the location of the first character of the sub-string found. Returns -1 if not found.
Scroll pagebreak |
---|
Examples
Code Block | ||
---|---|---|
| ||
// Search for a substring |
...
string $str = "This is some text"; |
...
int $index; |
...
...
// Search for the word "some" |
...
$index = `strFind $str "some" 0`; |
...
print $index; |
...
// Should be 8 |
...
...
// Search for the word "texas" |
...
$index = `strFind $str "texas" 0`; |
...
print $index; |
...
// Should be -1 |
...
...
// Search for the letter "t" after the word "some" |
...
$index = `strFind $str "t" 12`; |
...
print $index; |
...
// Should be 13 |
Additional information
Related commands
...