Summary
Gets the index of the first occurrence of a string value within another string.
Description
Returns the index within the first argument, str, of the first occurrence of the specified value, starting the search at fromIndex. Returns -1 if value not found
Route
POST /string/indexOf
Roles
admin
Parameters
DetailsExampleSchema
Name | Type | Required | Description |
---|---|---|---|
str | string | yes | The string to search |
searchValue | string | yes | The value to search for in str |
fromIndex | number | no | The index at which to start the search; default is 0 |
Return
DetailsExampleSchema
Name | Type | Description |
---|---|---|
index | number | The first occurrence of searchValue in str, or -1 if not found |