Returns the index of the first occurrence of substr in s. Returns -1 if not found.
Example:
assert (Strings.indexOf ("hello world", "world") == 6);
assert (Strings.indexOf ("hello", "xyz") == -1);
| s |
the string to search in. |
| substr |
the substring to find. |
|
index of first occurrence, or -1 if not found. |