Programmer Guide/Command Reference/TRIM: Difference between revisions

From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import)
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
==TRIM==
TRIM [ /Blanks ] [ /Characters=<var>abcde</var> ] [ /Leading ] [ /Trailing ] [ /Variables ] /- <var>string(s)</var>


<code>TRIM [ /B ] [ /C=abcde ] [ /L ] [ /T ] [ /V ] /- <var>string(s)</var></code>
The <code>TRIM</code> command removes characters from the beginning and/or from the end of one or more strings.


The <code>TRIM</code> command removes characters from the beginning and end of one or more strings.
For each supplied string, the <code>TRIM</code> command will remove all leading (option "<code>/Leading</code>") and/or trailing ("<code>/Trailing</code>") occurrences of any white space character (option "<code>/Blanks</code>") and/or of any character supplied as an argument to the "<code>/Characters</code>" option.
 
For each supplied string, the <code>TRIM</code> command will remove all leading (option "/L") and/or trailing ("/T") occurrences of any white space character (option "/B") and/or of any character supplied as an argument to the "/C" option.


The command returns the trimmed strings or, if more than one string is supplied, a blank-separated list of trimmed strings.
The command returns the trimmed strings or, if more than one string is supplied, a blank-separated list of trimmed strings.


If option "/V" is supplied, the arguments are considered o be the names of variables. In this case, the contents of the variables are trimmed.
If option "<code>/Variables</code>" is supplied, the arguments are considered to be the names of variables. In this case, the contents of the variables are trimmed.


Examples:
== Examples ==


<pre>
#a := trim /l /b /- '  string  '
#a := trim /l /b /- '  string  '
</pre>
will remove all leading white space characters
will remove all leading white space characters


<pre>
#a := trim /b /l /c=abc 'aaastringccc'
#a := trim /b /l /c=abc 'aaastringccc'
</pre>
will remove all leading and trailing occurrences of the characters "a", "b", and "c".
will remove all leading and trailing occurrences of the characters "a", "b", and "c".

Revision as of 15:21, 7 May 2014

TRIM [ /Blanks ] [ /Characters=abcde ] [ /Leading ] [ /Trailing ] [ /Variables ] /- string(s)

The TRIM command removes characters from the beginning and/or from the end of one or more strings.

For each supplied string, the 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.

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 variables. In this case, the contents of the variables are trimmed.

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".

Navigation menu

Personal tools