LAST_INDEX_OF_IGNORE_CASE

Description

Returns the starting position (zero-based index) of the last occurrence of substring within string, ignoring case differences. If end_position_optional is provided, the search considers characters from the start of the string up to the specified end position. Returns -1 if the substring is not found.

Syntax

LAST_INDEX_OF_IGNORE_CASE(string, substring, end_position_optional) -> Integer

Parameters

ParameterData TypeRequiredDescription
stringStringYesThe string to search within.
substringStringYesThe substring to locate.
end_position_optionalIntegerNoThe zero-based index indicating the end position for the search. If omitted, searches the entire string.

Examples

LAST_INDEX_OF_IGNORE_CASE("Status_OK|Status_Fail|Status_Pending", "STATUS", 20)
 -- Returns 10. Finds "Status" within the first 20 characters (case-insensitive).
LAST_INDEX_OF_IGNORE_CASE("Error: Info, Error: Warn, Error: Critical", "error")
 --Returns 26. Finds "Error" at index 26 (case-insensitive).