Determining the Length of Strings
The STRLEN function obtains the length of a string. It has the form:
result = STRLEN(string)
where string is the string for which the length is required.
For example, the following statement:
PRINT, STRLEN('This sentence has 31 characters')
results in the output:
31
while the following statement prints the lengths of all the names contained in the array TREES:
PRINT, STRLEN(TREES)
The resulting output from running this statement is:
5 5 8 5 3 4 6