Returns the length of the input parameter.
If not of type string, expr is converted to string using the default formatting rules of PV-WAVE. (These rules are described in Free Format Output in Chapter 8 of the PV-WAVE Programmer's Guide.)
a = 'a b c'
Create a scalar string.
PRINT, STRLEN(a)
5
Display the length of
a
.
b = 45
Create an integer scalar variable.
PRINT, STRLEN(b)
8
Display the length of b converted to string type.
c = STRING(FINDGEN(4), Format = '(f3.1)')
Create a four-element
vector of strings.
PRINT, TRANSPOSE(c)
0.0
1.0
2.0
3.0
Display the contents of
c
as a column vector.
PRINT, TRANSPOSE(STRLEN(c))
3
3
3
3
Display the vector of lengths of elements of c as a column vector.
; This vector is returned by STRLEN.