Previous Topic: FILTER Function--Test Set Elements

Next Topic: GET Function--Locate Attributes in a User Directory

FIND Function--Return Position in String

The FIND function finds the specified instance of the search string in the source string and returns its position. If the search string is not found, then the function returns a zero.

Syntax

The FIND function has the following format:

FIND(source_string, search_string[, not_case_sensitive][, n])

Parameters

The FIND function accepts the following parameters:

source_string (string)

search_string (string)

not_case_sensitive (Boolean)

(Optional) Specifies case sensitivity. If the not_case_sensitive flag is omitted or set to FALSE, the function searches the source string for an exact match. If the not_case_sensitive flag is set to TRUE, the FIND function ignores case.

n (number)

(Optional) Specifies the instance of the search string in the source string. If n is set to zero or one or omitted, the function finds the first instance of the search string. Otherwise, the function finds the nth instance of the search string. If n is negative, the function begins the search at the end of the source string.

Return Value

The FIND function returns a number.

Example

Return_value=FIND('PhoebePhoebe', 'oe', FALSE, 1)
Return_value=3

Return_value=FIND('PhoebePhoebe', 'OE', FALSE, 1)
Return_value=0

Return_value=FIND('PhoebePhoebe', 'OE', TRUE, 1)
Return_value=3

Return_value=FIND('PhoebePhoebe', 'oe', FALSE, -1)
Return_value=9

Return_value=FIND('PhoebePhoebe', 'OE', FALSE, -1)
Return_value=0

Return_value=FIND('PhoebePhoebe', 'OE', TRUE, -1)
Return_value=9

Return_value=FIND('PhoebePhoebe', 'oe', FALSE, 2)
Return_value=9

Return_value=FIND('PhoebePhoebe', 'OE', FALSE, 2)
Return_value=0

Return_value=FIND('PhoebePhoebe', 'OE', TRUE, 2)
Return_value=9

More information:

AFTER Function--Find a String

BEFORE Function--Find a String


Copyright © 2010 CA. All rights reserved. Email CA about this topic