...we had a little chat about string concatenation, and this inspired me to do a little StringBuilder implementation, as you might know it from .net/C#
It uses buffers, and as we have to take care to buffer_delete them, when we are done, I thought, the most convenient way is, that the class destroys the buffer after you request the contents via .toString()
I don't want to create a repository for a single function, so I thought, I'd share it here directly. In my library, I have unit tests for it. It works in the form posted below.
Methods are chainable, so you can do:
var postal_address = new StringBuilder()
.append_line(recipient_name)
.append(street).append_word(number).append_line()
.append(zip).append_word(city)
.toString();
and you get it all without string concatenation.
The lines above will result in something like
firstname lastname
some street 135
12345 star city
...is just wanted to show the append/append_line/append_word functions.
Hope, someone has use for it -- I have included it in the next raptor release
Have fun! Make Games!
Gris