String manipulation

INDEXOF – Find character index of first instance of a string

16 views June 1, 2018 admin 0

Overview

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

Syntax

INDEXOF(‘SearchIn’, ‘SearchFor’,StartIndex)

INDEXOF(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

INDEXOF(FIELDSTR(‘Manufacturer’), ‘Apple’)

Manufacturer

INDEXOF(FIELDSTR(‘Manufacturer’), ‘Apple’)

Apple iMac

0

I like Apples

7

Dell Computer

-1

Apple iMac by Apple, Inc.

0

INDEXOF(FIELDSTR(‘Manufacturer’), ‘Apple’, 3)

Manufacturer

INDEXOF(FIELDSTR(‘Manufacturer’), ‘Apple’, 3)

Apple iMac

0

I like Apples

7

Dell Computer

-1

Apple iMac by Apple, Inc.

14

See also

LASTINDEXOF

Was this helpful?