replch |
Table of contents
ProcedureREPLCH ( Replace characters in a string ) SUBROUTINE REPLCH ( INSTR, OLD, NEW, OUTSTR ) AbstractReplace all occurrences of a single character with a second character. Required_ReadingNone. KeywordsASCII CHARACTER DeclarationsIMPLICIT NONE CHARACTER*(*) INSTR CHARACTER*1 OLD CHARACTER*1 NEW CHARACTER*(*) OUTSTR Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- INSTR I Input string. OLD I Character to be replaced. NEW I Replacement character. OUTSTR O Output string. Detailed_InputINSTR is the input character string, possibly containing one or more occurrences of the character OLD. OLD is the character to be replaced wherever it occurs in the input string. NEW is the character which is to replace each occurrence of the character OLD in the output string. Detailed_OutputOUTSTR is the output string. This is the input string with every occurrence of the character OLD replaced by the character NEW. OUTSTR may overwrite INSTR. ParametersNone. ExceptionsError free. FilesNone. ParticularsCopy the contents of the input string to the output string a character at a time, replacing each occurrence of OLD with NEW. If the output string is not long enough to contain the input string, it is truncated on the right. ExamplesLet INSTR = 'Woodsy is the Anti-Pollution Owl.' OLD = 'O' NEW = 'E' then OUTSTR = 'Woodsy is the Anti-Pollution Ewl.' Note the case-sensitivity of REPLCH. The lowercase o's are not affected. REPLCH may similarly be used to replace control characters (such as tab stops, line feeds, and nulls) with regular ASCII characters (such as blanks). Restrictions1) REPLCH is sensitive to case, as shown in the examples above. Literature_ReferencesNone. Author_and_InstitutionJ. Diaz del Rio (ODC Space) W.L. Taber (JPL) I.M. Underwood (JPL) VersionSPICELIB Version 1.1.0, 12-AUG-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) (IMU) |
Fri Dec 31 18:36:43 2021