How to: |
The TRIMV function removes a pattern from a string and is similar to TRIM. However, both the source string and the pattern of characters to remove can have an AnV format.
Note: The TRIMV function is useful for converting an An field to an AnV field (with the length-in-bytes containing the actual length of the data up to the last non-blank character).
TRIMV(trim_where, source_string, upper_limit, pattern, pattern_limit, output_format)
where:
Alphanumeric
Is one of the following, which indicates where to remove the pattern:
Alphanumeric of type AnV or An
Is the string to truncate. If it is a field of type AnV, its length is taken from the length-in-bytes of the field. If the upper_limit is smaller than the length, the source_string is truncated to the upper_limit.
Integer
Is the limit value for the length of the source_string.
Alphanumeric of type AnV or An
Is the pattern to remove. If it is a field of type AnV, its length is taken from the length-in-bytes of the field. If the pattern_limit is smaller than the length, the pattern is truncated to the pattern_limit.
Integer
Is the limit for the length of the pattern.
Alphanumeric type AnV or An
If the format is AnV, the length is set equal to the number of characters left after trimming.
TRIMV removes trailing blanks from TITLE and stores the result in a column with the format A39V:
TRIMV('T', TITLE, 39, ' ', 1, 'A39V')
iWay Software |