String Concatenation
The addition operator is used to concatenate strings. For example, the command:
results in the following output:
Strings can also be broken across code lines:
results in the following output:
The following IDL statements build a scalar string containing a comma-separated list of the names found in the TREES string array:
; Create array of trees. trees = ['Beech', 'Birch', 'Mahogany', 'Maple', 'Oak', $ 'Pine', 'Walnut'] ; Use REPLICATE to make an array with the correct number of commas ; and add it to trees. names = trees + [REPLICATE(',', N_ELEMENTS(trees)-1), ''] ; Show the resulting list. PRINT, names
Running the above statements results in the following output: