Finding the Length of a String
The STRLEN function is used to obtain the length of a string. It has the form:
L = STRLEN(String)
where String is the string for which the length is required. For example, the following statement
results in the output
while the following IDL statement prints the lengths of all the names contained in the array TREES.
; Create array of trees. trees = ['Beech', 'Birch', 'Mahogany', 'Maple', 'Oak', $ 'Pine', 'Walnut'] PRINT, STRLEN(trees)
The resulting output is as follows: