|
The TRIMS() function removes excess characters from strings in a dynamic array, operating on each element in turn and returning an equivalently structured dynamic array of trimmed strings.
Format
TRIMS(string)
TRIMS(string, character{, mode})
where
| string | evaluates to the string to be trimmed. |
| character | is the character to be removed |
| mode | evaluates to a single character which determines the mode of trimming: |
| A | Remove all occurrences of character. |
| B | Remove all leading and trailing occurrences of character. |
| C | Replace multiple instances of character with a single character. |
| D | Remove all leading and trailing spaces, replacing multiple embedded spaces with a single space. The value of character is ignored. |
| E | Remove all trailing spaces. The value of character is ignored. |
| F | Remove all leading spaces. The value of character is ignored. |
| L | Remove all leading occurrences of character. |
| R | Remove all leading and trailing occurrences of character, replacing multiple embedded instances of character with a single character. |
| T | Remove all trailing occurrences of character. |
The first format of the TRIMS() function removes all leading and trailing spaces from each dynamic array element of string and replaces multiple embedded spaces by a single space.
The second form is more generalised and allows other characters to be removed.
Example
A = " 1 2 3 " : @FM : " 4 5 6"
B = TRIMS(A)
B becomes "1 2 3FM4 5 6"
See also:
TRIM(), TRIMB(), TRIMF(), TRIMW()
|