|
|
|
|
|
by mwsherman
268 days ago
|
|
I move between Go and C#. I wrote a zero-allocation package in Go [1] and then ported to C# — and the allocations exploded! I had forgotten, or perhaps never realized, that substrings in C# allocate. The solution was Spans. Notably, it caused me to realize that Go had “spans” designed in from the start. [1] https://github.com/clipperhouse/uax29 |
|
To work with strings you should use StringBuilder.