logoalt Hacker News

sgbealtoday at 5:33 PM0 repliesview on HN

Slight correction:

> StringBuilder works off a single mutable character buffer. One allocation.

It's one allocation to instantiate the builder and _any_ number of allocations after that (noting that it's optimized to reduce allocations, so it's not allocating on every append() unless they're huge).