When I have an empty StringBuilder
with a capacity of 5 and I write "hello, world!" to it, does the C# standard specify the new capacity of the StringBuilder
? I have a vague memory that it's twice the new string's length (to avoid changing the capacity with every new appended string).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…