You are viewing content for 5.1 | 5.0 | 4.9 | 4.8 | 4.7 | 4.6 | 4.5 | 4.4 | 4.3 | Previous Releases


findLast

Returns the index of the last substring match.

Example

Find the index of the last “a” in “banana”.

findLast("a", "banana")

This example returns 5.

Syntax

findLast(string expr s, string expr field)
  • s: the string to search for
  • field: the string to be searched

Both s and field are expressions evaluating to strings.

Returns

int

Notes

findLast finds the last occurrence of a string within another string. The index returned corresponds to where s first matches in field. If there is no match, findLast returns -1.

© Incorta, Inc. All Rights Reserved.