Maximum number of characters stringbuilder can accommodate

前端 未结 3 479
[愿得一人] 2021-02-20 17:54

I need to write 10,000 x 30,000 characters. will a single stringbuilder be able to acomodate all characters or should I think of an array of stringbuilders? I do not have access

  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-20 18:26

    As long as the length of the character sequence contained in the string builder does not exceed the capacity, it is not necessary to allocate a new internal buffer. If the internal buffer overflows, it is automatically made larger. And it gives you the max number of chars this StringBuilder instance memory can hold at this time.