How to: |
The TRIM_ function removes all occurrences of a single character from either the beginning or end of a string, or both.
TRIM_(trim_where, trim_character, source_string)
where:
Keyword
Defines where to trim the source string. Valid values are:
Alphanumeric
Is a single character, enclosed in single quotation marks ('), whose occurrences are to be removed from source_string. For example, the character can be a single blank (‘ ‘).
Alphanumeric
Is the string to be trimmed.
The data type of the returned string is AnV.
In the following request, TRIM_ removes leading occurrences of the character ‘B’ from the DIRECTOR field:
TABLE FILE MOVIES PRINT DIRECTOR AND COMPUTE TRIMDIR/A17 = TRIM_(LEADING, 'B', DIRECTOR); WHERE DIRECTOR CONTAINS 'BR' ON TABLE SET PAGE NOPAGE END
The output is:
DIRECTOR TRIMDIR -------- ------- ABRAHAMS J. ABRAHAMS J. BROOKS R. ROOKS R. BROOKS J.L. ROOKS J.L.
WebFOCUS |