next up previous
Next: CHR_INSET - Return whether a string is a member of a given set
Up: Routine Descriptions
Previous: CHR_IACHR - Return the ASCII value for the given character

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.



next up previous
Next: CHR_INSET - Return whether a string is a member of a given set
Up: Routine Descriptions
Previous: CHR_IACHR - Return the ASCII value for the given character



CHR Character Handling Routines
Starlink User Note 40
A C Charles
P C T Rees
A J Chipperfield
2 August 1995
E-mail:ussc@star.rl.ac.uk