You can determine the number of characters in
a macro variable, and use string operators to extract substrings from
the value of the variable. Table 28
§28.6.2 Understanding operands and operators
Table 28
Table 28
For example, to trim off the first four characters of $$mystring:
<$$mystring = ($$yourstring trim first 4)>
If the value of $$yourstring is “makework”, the value of $$mystring would be “work”.
Implied value of second operand
If the second operand N is missing from an expression that uses one of the following operators, a value of 1 (one) is assumed for N:
For example, to select only the last character, you can omit the second operand:
<$$yourstring = ($$mystring last)>
If the value of $$mystring is “groceries”, the value of $$yourstring would be “s”.