Index of Functions: A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 
Index Page
lastnb_c

Table of contents
Procedure
Abstract
Required_Reading
Keywords
Brief_I/O
Detailed_Input
Detailed_Output
Parameters
Exceptions
Files
Particulars
Examples
Restrictions
Literature_References
Author_and_Institution
Version
Index_Entries

Procedure

   lastnb_c ( Last non-blank character ) 

   SpiceInt lastnb_c ( ConstSpiceChar * string )

Abstract

   Return the zero based index of the last non-blank character in
   a character string.

Required_Reading

   None.

Keywords

   ASCII
   CHARACTER
   SEARCH


Brief_I/O

   VARIABLE  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_Input

   string      is the input character string.

Detailed_Output

   The 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.

Parameters

   None.

Exceptions

   1)  If the `string' input string pointer is null, the error
       SPICE(NULLPOINTER) is signaled. The function returns the value
       -1.

Files

   None.

Particulars

   If 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

Restrictions

   None.

Literature_References

   None.

Author_and_Institution

   N.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_Entries

   last non-blank character
Fri Dec 31 18:41:08 2021