Reviewed June 2020
xcall TRIM, strvar {,flag}
TRIM.SBR removes both leading and trailing blanks from the specified string variable. In addition, it can optionally remove other non-printable characters.
Parameters
strvar (String) [in/out]
is the string variable from which you want to trim the leading and trailing spaces. 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) or greater than 127 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. |