字符串生成器对象的大小是多少,如何清除其内容? [英] What is the size of string builder object and how can i clear its content ?

查看:86
本文介绍了字符串生成器对象的大小是多少,如何清除其内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在使用字符串"构建器对象,并将大量数据附加到该对象上.
我不确定程序的末尾会追加多少数据.
请让我知道我可以附加的最大数据.
另外,请让我知道是否存在清除数据并将新数据重新添加到同一对象上的方法.

Hello all,
I am using the String builder object and appending lots of data onto it.
I am not sure at the end of my program how much data will i be appending to it.
Please let me know the max data i can append to it.
Also please let me know if there is a way to clear the data and reappend new data on the same object.

推荐答案


来自文档[
From the documentation [^]:
>
StringBuilder.MaxCapacity属性

获取此实例的最大容量.


StringBuilder.MaxCapacity Property

Gets the maximum capacity of this instance.




从另一个文档页面[
^ ]:




From another documentation page [^]:

>
StringBuilder.Clear方法

从当前StringBuilder实例中删除所有字符.

StringBuilder.Clear Method

Removes all characters from the current StringBuilder instance.



:)



:)


这篇关于字符串生成器对象的大小是多少,如何清除其内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆