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 37-9 lists several of the string operators and shows how they are used in macro expressions.
§37.6.2 Understanding operands and operators
Table 37-6 Operators for HTML macro expressions
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:
char first last trim first trim last
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”.