app-string

On this page:

lastIndexOf

Summary

Gets the index of the last occurrence of a string value within another string.

Description

Returns the index within the str of the last occurrence of the specified value, searching backwards from fromIndex.

Route

POST /string/lastIndexOf

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. If empty string, fromIndex is returned
fromIndex number no The index of the last character in the string to be considered at the beginning of a match

Return

DetailsExampleSchema
Name Type Description
index number The last occurrence of searchValue in searchStr, or -1 if not found