Overview of Strings

An IDL string is a sequence of characters from 0 to 2147483647 (2.1 GB) characters in length. Strings have dynamic length (they grow or shrink to fit), and there is no need to declare the maximum length of a string prior to using it. As with any data type, string arrays can be created to hold more than a single string. In this case, the length of each individual string in the array depends only on its own length and is not affected by the lengths of the other string elements.

Note
This chapter covers operations on strings. For information about using the ` and "characters to create valid strings, see String Constants.

A Note About the Examples

In some of the examples in this chapter, it is assumed that a string array named TREES exists. TREES contains the names of seven trees, one name per element, and is created using the statement:

trees = ['Beech', 'Birch', 'Mahogany', 'Maple', 'Oak', $ 
         'Pine', 'Walnut'] 

Executing the statement,

PRINT, '>' + trees + '< ' 

results in the following output:

>Beech<  >Birch<  >Mahogany<  >Maple<  >Oak<  >Pine<  >Walnut<