Reviewed June 2020
xcall TRIM, strvar {,flag}
TRIM removes leading spaces, trailing spaces and tabs from the specified string. In addition, it can optionally remove other control characters.
Parameters
strvar (String) [in/out]
is the string variable from which you want to trim the leading spaces, trailing spaces, or tabs. It does not need a trailing null byte.
flag (Num) [in]
may be specified as any non-zero value to cause TRIM to treat any characters with ASCII values less than 32 (space) the same as space—i.e. remove them. Like spaces, they must still be prior to the first printable character or after the last one, and prior to the first null, to be removed. Any spaces or other control characters that are embedded between printable characters are left alone.
See Also
• | The EDIT$() function which supports the ability to remove certain types of characters within (rather than just at the beginning or end of) the string. |
• | The SBR=TRIMCTL setting in the system parameters file, which forces TRIM to act as if a nonzero flag value had been passed. |
• | XSTRIP, which provides more sophisticated removal of specific characters from string. |
• | String function TRIM(a$) |