>  Docs Center  >  Libraries  >  ASTROLIB  >  STRCOMPRESS2

STRCOMPRESS2

STRCOMPRESS2

Name


STRCOMPRESS2

Purpose


Remove blanks around specified characters in a string

Calling Sequence


newstring = strcompress2( st, chars)

Inputs


      st - any scalar string
      chars - scalar or vector string specifing which characters around which
            blanks should be removed. For example, if chars=['=','-','+']
              then spaces around the three characters "=', '-', and '+' will
            be removed.

Outputs


      newstring - input string with spaces removed around the specified
        characters.

Example


      The Vizier constraint string (see queryvizier.pro) does not allow
      blanks around the operators '=','<', or '>'. But we do not want
      to remove blanks around names (e.g. 'NGC 5342'):
 
      IDL> st = 'name = NGC 5342, v< 23'
      IDL> print,strcompress2(st, ['=','<','>'])
            name=NGC 5342, v<23

Modification History


Written by W.Landsman July 2008



© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us