strbuilder
.zn moduleO(n) string assembly (vs. O(n²) repeated +). import "strbuilder". Builder uses method-call syntax with ->.
strbuilder.new() => Builderb->write(s: string)b->write_line(s: string)b->to_string() => stringb->count() => intb->reset()
strbuilder.new() => Builder
Empty builder.
b->write(s: string)
Append a piece.
b->write_line(s: string)
Append a piece followed by a newline.
b->to_string() => string
The assembled string.
b->count() => int
Number of pieces written.
b->reset()
Discard all pieces.
import "strbuilder"
b := strbuilder.new()
b->write("hello")
b->write(", ")
b->write("world")
println(b->to_string()) // hello, world