Removes extra blank spaces from an input string.
If not of type string, string 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 String '
Create a string with both leading and trailing blanks.
INFO, a
Examine the contents of
a
. Note the presence of both leading and
; trailing blanks.
VARIABLE STRING = ' A String ' b = STRTRIM(a)
Remove trailing blanks from
a
.
INFO, b
VARIABLE STRING = ' A String'
Note that all trailing blanks are removed.
b = STRTRIM(a, 1)
Remove leading blanks from a.
INFO, b
VARIABLE STRING = 'A String '
Examine the results. Note that all leading blanks are removed.
b = STRTRIM(a, 2)
Remove both leading and trailing blanks from a.
INFO, b
VARIABLE STRING = 'A String'
Note that all leading and trailing blanks are removed.