The Index function is a built-in function that returns the zero-based position in text t where search text can be found. By default, the function is case sensitive. Returns –1 if search is not found or if search is empty.

In an Aggregate expression there is no optional input parameter.

Input parameters

t: mandatory; Text Type.
The text where the search text can be found.

search: mandatory; Text Type.
The text string to be found.

startIndex: optional; Integer Type.
Indicates the (zero-based) index where the search starts. In case of searching from the end to the start, a startIndex different from 0 (zero) indicates the end of the text. The default value is 0 (zero).

searchFromEnd: optional; Boolean Type.
Indicates the direction of the search. In case of searching from the end to the start, a startIndex different from 0 (zero) indicates the end of the text. The default value is False.

ignoreCase: optional; Boolean Type.
If set to True, uppercase and lowercase characters are considered to be the same. The default value is False.

Output parameters

Integer Type

Examples

Usage

Development environment

Aggregate

Index( "First string", "F" )

Index( "First string", "st" )

Index( "First string", "xx" )

0

3

-1

0

3

-1

Index( "First string", "F", startIndex: 5 )

Index( "First string", "st", startIndex: 5 )

Index( "First string", "xx", startIndex: 5 )

-1

6

-1

(not applicable)

(not applicable)

(not applicable)

Index( "First string", "F", searchFromEnd: True )

Index( "First string", "st", searchFromEnd: True )

Index( "First string", "xx", searchFromEnd: True )

0

6

-1

(not applicable)

(not applicable)

(not applicable)

Index( "First string", "f" )

Index( "First string", "f", ignoreCase: True )

-1

0

-1

(not applicable)

Index( "", "xx" )

Index( "First string", "" )

Index( "", "" )

-1

-1

-1

-1

-1

-1

See Also

Available Text Functions | Available Built-in Functions