Handlebars Helper Function: indexOf

Returns the character position where a search string exists within a subject string. The search is case-insensitive and uses 1-based indexing.

Availability

This helper is available in the Winter ’26 release of Marketing Cloud Next.

Syntax

{{indexOf subject search}}

Parameters

Parameter Type Description
subject String Required. The string to search within.
search String Required. The string to find within the subject.

Return Value

The function returns the 1-based position where the search string is found in the subject string. If the search string isn’t found or if either parameter is null, it returns 0. The search is case-insensitive.