index of
finds the first occurrence of a substring in a string
(string subject, string search, long start) -> long
If subject
contains search
at or after index start
, returns the index of the first such occurrence. Returns -1
otherwise.
Returns nil
if any argument is nil
.
Parameters
Name | Type | Description |
---|---|---|
subject |
string | The string to search in |
search |
string | The string to find |
start |
long |
The index of the first character where search should begin. Indexes are zero-based, i.e. the first character is at index 0. |