Returns the last index at which a specified substring can be found in a string; otherwise, 0 is returned, indicating the substring is not present. The string is searched forwards, ending at a given index when specified.
- The source string in which the substring is to be located.
- The substring to locate in the source string.
- The index at which to end the search. A negative index can be used, indicating an offset from the end of the source string.
- The index of the last occurrence of the substring, or
$sentence: 'The quick brown fox jumps over the lazy dog.';
@debug string.last-index($sentence, 'he');
@debug string.last-index($sentence, 'cat');