Programmer Guide/Command Reference/TRIM: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
{{PG_StringCommands}} | {{PG_StringCommands}} | ||
TRIM [ /Blanks ] [ /Characters=<var>abcde</var> ] | TRIM [ /Blanks ] [ /Characters=<var>abcde</var> ] /Leading|/Trailing [ /Variables ] /- <var>string(s)</var> | ||
The {{Stx}} <code>TRIM</code> command removes characters from the beginning and/or from the end of one or more strings. | The {{Stx}} <code>TRIM</code> command removes characters from the beginning and/or from the end of one or more strings. |
Revision as of 10:17, 15 February 2019
TRIM [ /Blanks ] [ /Characters=abcde ] /Leading|/Trailing [ /Variables ] /- string(s)
The STx TRIM
command removes characters from the beginning and/or from the end of one or more strings.
For each supplied string, the STx TRIM
command will remove all leading (option "/Leading
") and/or trailing ("/Trailing
") occurrences of any white space character (option "/Blanks
") and/or of any character supplied as an argument to the "/Characters
" option (both options may be combined).
The command returns the trimmed strings or, if more than one string is supplied, a blank-separated list of trimmed strings.
If option "/Variables
" is supplied, the arguments are considered to be the names of STx variables. In this case, the trimmed content of the respective variables is returned. The variables themselves are not altered.
Examples
#a := trim /l /b /- ' string '
will remove all leading white space characters
#a := trim /b /l /c=abc 'aaastringccc'
will remove all leading and trailing occurrences of the characters "a", "b", and "c".