wdindx |
Table of contents
ProcedureWDINDX ( Index of a Word Within a String ) INTEGER FUNCTION WDINDX ( STRING, WORD ) AbstractFind the index of a word within a string. If the word does not exist as a word within the string, the value zero is returned. Required_ReadingNone. KeywordsPARSING SEARCH WORD DeclarationsIMPLICIT NONE CHARACTER*(*) STRING CHARACTER*(*) WORD Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- STRING I String of characters, potentially containing words WORD I A string of consecutive printable letters. The function returns the location of WORD within STRING. Detailed_InputSTRING is a string of characters, potentially containing the word. Leading and trailing blanks are not significant in STRING. WORD is a string of consecutive printable characters. Leading and trailing blanks are not significant in WORD. Detailed_OutputThe function returns the location of WORD within STRING, providing the index of the first letter of WORD within the input STRING. If WORD does not exist or WORD is blank, the function returns zero. ParametersNone. ExceptionsError free. FilesNone. ParticularsA word within a string is a substring beginning and ending with a non-blank characters that is delimited by blanks on each end. (A blank is assumed to precede and follow the first and last characters of a string.) Given a word, this routine returns the index of the first letter of the first word of STRING that matches the word. ExamplesSTRING: 1 2 3 4 WORD 1234567890123456789012345678901234567890123456 WDINDX ------ ---------------------------------------------- ------ 'POT' 'PUT THE POTATOES IN THE POT' 25 'TOES' 0 'PUT' 1 'THE' 5 'IN THE' 18 'THE PO' 0 RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionJ. Diaz del Rio (ODC Space) W.L. Taber (JPL) VersionSPICELIB Version 1.1.0, 03-OCT-2021 (JDR) Added IMPLICIT NONE statement. Edited the header to comply with NAIF standard. SPICELIB Version 1.0.1, 10-MAR-1992 (WLT) Comment section for permuted index source lines was added following the header. SPICELIB Version 1.0.0, 31-JAN-1990 (WLT) |
Fri Dec 31 18:37:07 2021