strStr Function
Use
Purpose
Searches for a substring within a string.
Syntax
int strStr (in string string, in string stringPattern)
Parameters
|
string |
The string in which to search. |
|
stringPattern |
The string to search for. |
Return Value
|
Condition |
Return Value |
|
If string does not contain stringPattern. |
0 |
|
If string contains stringPattern. In this case, the non-zero value tells the starting position where the substring was found. |
>0 |
Example
`strStr("Hello world", "world")`