You are here: Function Reference > Alphabetical Listing > F > Find

Find

Use this function to return the position of a substring within another string.

Syntax

Find (String, Substring, Integer)

Parameter

Description

String

Enter a valid string. The default is the value of the current field.

Substring

A string of one or more characters that will be located in parameter one.

Integer

Choose from these options:

0 - a left to right search
1 - a right to left search

Both search options return a position relative to the first (left-hand) character of the string parameter.

The default is zero (0).

The system returns a zero (0) if the substring is not found in the search string, otherwise it returns the position of the substring. The search is not case sensitive.

Example

Here are some examples:

(Assume the current field contains the text Insured's responsibility.)

Function

Result

Explanation

Return(Find ( , "RESP" ))

11

Defaults to the current field and finds the first occurrence of "RESP" at position 11. Note that the search is not case sensitive.

Return(Find ( , "usual and customary"))

0

The term "usual and customary" is not found in the current field.

Return(Find ("Complete all the blanks.", "all"))

10

Searching left to right, "all" was first found at position 10.

Return(Find ("Complete all the blanks.", "all", 1))

10

Searching right to left, "all" was first found at position 10.

See also