dotnet / dotnet/dotnet-api-docs
Why the StringBuilder object is chunky even after the data from the original buffer is copied to the new buffer?
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
https://github.com/dotnet/dotnet-api-docs/blob/7668d4bac38aff3ce335fed5c840cdd6730edf5a/xml/System.Text/StringBuilder.xml#L87
Hi,
1. The buffer of the StringBuilder object will be extended automatically and the data of the original buffer will be coped to the new buffer.

2. Why the StringBuilder object is "chunky"?
There is always a continuous buffer but not chunky as the buffer will be extended automatically.
3. Why the Chars[int32] property is not O(1)?
The buffer is continuous, so, Chars[int32] property is O(1).

Contributor guide
Assessment
This issue has not been assessed yet.