StringBuffer:clear()
Reset the StringBuffer to zero length. This does not free any memory, instead only truncating whatever is currently in the StringBuffer to zero length. It is much more efficient to reuse a StringBuffer by using StringBuffer:clear() than it is to create a new StringBuffer.
Example
sb = StringBuffer.new()
sb:append('foo');
sb:clear()