IDL

STRCOMPRESS

STRCOMPRESS

The STRCOMPRESS function returns a copy of String with all whitespace (blanks and tabs) compressed to a single space or completely removed.

Examples


; Create a string variable S:
S = 'This is a string with spaces in it.'
; Print S with all of the whitespace removed:
PRINT, STRCOMPRESS(S, /REMOVE_ALL)

IDL Output

Thisisastringwithspacesinit.

Syntax


Result = STRCOMPRESS( String [, /REMOVE_ALL] )

Return Value


The result is a compressed string.

Arguments


String

The string to be compressed. If not of type string, it is converted using IDL’s default formatting rules. If String is an array, the result is an array with the same structure—each element contains a compressed copy of the corresponding element of String.

Keywords


REMOVE_ALL

Set this keyword to remove all whitespace. Normally, all whitespace is compressed to a single space.

Version History


Original

Introduced

See Also


String Operations, String Processing, STRTRIM



Notes


This page has no user notes yet. Be the first one!


This information is not subject to the controls of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However, it may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
© 2014 Exelis Visual Information Solutions