Checks if a string contains a given substring.
StringInStr ( "string", "substring" [, casesense [, occurrence [, start [, count]]]] )
| string | The string to evaluate. |
| substring | The substring to search for. |
| casesense | [optional] Flag to indicate if the operations should be case sensitive. 0 = not case sensitive, using the user's locale (default) 1 = case sensitive 2 = not case sensitive, using a basic/faster comparison |
| occurrence | [optional] Which occurrence of the substring to find in the string. Use a negative occurrence to search from the right side. The default value is 1 (finds first occurrence). |
| start | [optional] The starting position of the search. |
| count | [optional] The number of characters to search. This effectively limits the search to a portion of the full string. See remarks. |
| Success: | Returns the position of the substring. |
| Failure: | Returns 0 if substring not found. |
| @Error | 0 - Normal operation |
| 1 - Invalid "start" or "occurence" parameter given. |
Local $result = StringInStr("I am a String", "RING")
MsgBox(0, "Search result:", $result)
Local $location = StringInStr("How much wood could a woodchuck chuck is a woodchuck could chuck wood?", "wood", 0, 3) ; Find the 3rd occurance of "wood"