pos()

Examples


The pos() function returns a numeric value indicating the starting position of a string within a string or text field, or another string. For example, if the first character of the string you are searching for is found in the fifth position in the string you are searching (the target string), the return value is 5. If the string you are searching for isn’t found in the target string, the return value is 0.

Syntax

pos(target, search, start)

Parameters

target – The string, text field or string field you want to search in.

search – The string you want to search for.

start – The position at which the search will start in the target string.

Return value

Integer

Comments

The pos() function is most commonly used in conjunction with substring() function. The pos() function supplies an in parameter used by the substring() function indicating the starting position of the desired substring within the string.


Documentation Feedback