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
cspice_lastnb

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   CSPICE_LASTNB returns the integer value for the index of the final
   non-blank (not a space) character in a character string.

I/O


   Given:

      string   the input character string.

               help, string
                  STRING = Scalar

   the call:

      lastnb = cspice_lastnb( string )

   returns:

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

               help, lastnb
                  LONG = Scalar

               If the string is entirely blank or is empty, the value -1 is
               returned.

Parameters


   None.

Examples


   Any numerical results shown for this example may differ between
   platforms as the results depend on the SPICE kernels used as input
   and the machine specific arithmetic implementation.

   1) Given a set of strings, find the index of the last non-blank
      character on each of them.

      Example code begins here.


      PRO lastnb_ex1

         print, 'String : "01234567   "'
         print, FORMAT='("  Index: ", I2)', $
                cspice_lastnb( '01234567   ' )

         print, 'String : "    01234567   "'
         print, FORMAT='("  Index: ", I2)', $
                cspice_lastnb( '    01234567   ' )

         print, 'String : " 01234567   "'
         print, FORMAT='("  Index: ", I2)', $
                cspice_lastnb( ' 01234567   ' )

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      String : "01234567   "
        Index:  7
      String : "    01234567   "
        Index: 11
      String : " 01234567   "
        Index:  8


Particulars


   If the string is blank or empty, return -1. Otherwise, step backwards
   from the end of the string, one character at a time, until
   something other than a blank is found. Return the index of that
   character within the string.

Exceptions


   1)  If the input argument `string' is undefined, an error is
       signaled by the IDL error handling system.

   2)  If the input argument `string' is not of the expected type, or
       it does not have the expected dimensions and size, an error is
       signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ

Literature_References


   None.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)
   E.D. Wright         (JPL)

Version


   -Icy Version 1.0.1, 27-AUG-2021 (JDR)

       Edited the header to comply with NAIF standard. Added
       example's problem statement and reformatted example's output.

       Removed reference to 0-based indexing from -Abstracts as it
       it present in the relevant argument description.

       Added -Parameters, -Exceptions, -Files, -Restrictions,
       -Literature_References and -Author_and_Institution sections, and
       completed -Particulars section.

       Removed reference to the routine's corresponding CSPICE header from
       -Abstract section.

       Added arguments' type and size information in the -I/O section.

   -Icy Version 1.0.0, 16-JUN-2003 (EDW)

Index_Entries


   last non-blank character



Fri Dec 31 18:43:05 2021