Miscellaneous utilities

LASTINDEXOF – Find character index of last instance of a string

101 views June 1, 2018 admin 0

Overview

This Custom Field returns the character index of the last instance of one string within another, or -1 if the last string does not contain the second.

Syntax

LASTINDEXOF(‘SearchIn‘, ‘SearchFor‘,StartIndex)

LASTINDEXOF(FIELDSTR(Description),‘A’, n)

Element Description
SearchIn A string to search within.
SearchFor A string to serach for.
StartIndex The character index to start searching at. Default is 0. (Optional field.)

Examples

LASTINDEXOF(FIELDSTR(‘Body Copy’), ‘Apple’)

Body Copy

LASTINDEXOF(FIELDSTR(‘Body Copy’), ‘Apple’)

Apple iMac

0

I like Apples

7

Dell Computer

-1

Apple iMac by Apple, Inc.

14

LASTINDEXOF(FIELDSTR(‘Body Copy’), ‘Apple’, 3)

Body Copy

LASTINDEXOF(FIELDSTR(‘Body Copy’), ‘Apple’, 3)

Apple iMac

0

I like Apples

-1

Dell Computer

-1

Apple iMac by Apple, Inc.

0

See also

INDEXOF

Was this helpful?