StringBuffer:toString()
Convert a StringBuffer into a Lua string. The Lua tostring function can also be used to convert a StringBuffer into a Lua string. It is more efficient to return a StringBuffer as a result back to the database rather than using toString to convert a StringBuffer to a string and then returning the string.
Example
sb = StringBuffer.new()
sb:append('the quick brown fox')
str1 = sb:toString()
str2 = tostring(sb)