| lastnb_c |
|
Table of contents
Procedurelastnb_c ( Last non-blank character ) SpiceInt lastnb_c ( ConstSpiceChar * string ) AbstractReturn the zero based index of the last non-blank character in a character string. Required_ReadingNone. KeywordsASCII CHARACTER SEARCH Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- string I Input character string. The function returns the zero-based index of the last non-blank character in a character string. Detailed_Inputstring is the input character string. Detailed_OutputThe function returns the zero-based index of the last non-blank character in a character string. If the string is entirely blank or is empty, the value -1 is returned. ParametersNone. Exceptions
1) If the `string' input string pointer is null, the error
SPICE(NULLPOINTER) is signaled. The function returns the value
-1.
FilesNone. ParticularsIf the string is blank or null, return -1. Otherwise, step through the string one character at a time until something other than a blank is found. Return the zero based index of that something within the string. Note that if the length of the string to the last non-blank character is of interest, that value is the returned value plus one. Examples
The following examples illustrate the use of lastnb_c.
last = lastnb_c ( "ABCDE" );
last is 4
last = lastnb_c ( "AN EXAMPLE" );
last is 9
last = lastnb_c ( "AN EXAMPLE " );
last is 9
last = lastnb_c ( " " )
last is -1
RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) K.R. Gehringer (JPL) I.M. Underwood (JPL) E.D. Wright (JPL) Version
-CSPICE Version 1.1.1, 10-AUG-2021 (JDR)
Edited the header to comply with NAIF standard.
-CSPICE Version 1.1.0, 27-AUG-1999 (NJB)
Added check for null input string. Added some further comments
to the -Brief_I/O and -Detailed_Output header sections.
-CSPICE Version 1.0.0, 08-FEB-1998 (KRG) (IMU) (EDW)
Index_Entrieslast non-blank character Link to routine lastnb_c source file lastnb_c.c |
Fri Dec 31 18:41:08 2021