base.StringBuffer.trimWhiteSpace
Remove leading and trailing whitespace characters.
Syntax
trimWhiteSpace()
Usage
The trimWhiteSpace()
method removes the leading and trailing whitespace
characters in the string buffer.
The method considers as whitespace characters all characters less than or equal to blank space
(ASCII(32)
). This includes tab (\t
), newline
(\n
), carriage-return (\r
) and form-feed
(\f
).
Example
MAIN
DEFINE buf base.StringBuffer
LET buf = base.StringBuffer.create()
CALL buf.append("\n\t abc \n\t")
CALL buf.trimWhiteSpace()
DISPLAY "["||buf.toString()||"]" -- Shows [abc]
END MAIN
Output:
[abc]