CHR_INDEX

Return the index of a substring in a string

Description:

Find the position of a substring within a given string. If no substring is found, the value zero is returned.

Invocation

RESULT = CHR_INDEX( STRING, SUBSTR )

Arguments

STRING = CHARACTER ( ) (Given)
The string to be searched.
SUBSTR = CHARACTER ( ) (Given)
The substring to be used in the search.

Returned Value

CHR_INDEX = INTEGER
The position of SUBSTR within STRING.

Notes:

This routine is OBSOLETE. It exists for historical reasons. Its function is identical to the Fortran intrinsic function INDEX. It is recommended that the INDEX intrinsic function be called directly.