我正在使用 VB 的 StringBuilder,我很好奇什么被认为是清空构建器/将其设置为新字符串的“最佳实践”。会不会是这样的:
Dim str As New System.Text.StringBuilder()
str.Append("Some string to remove")
str = new System.Text.StringBuilder()
str.Append("Ahh, fresh new text!")
或者,还有更好的方法?
谢谢
最佳答案
我通常只使用:
str.Length = 0
关于vb.net - 将VB StringBuilder设置为空字符串的合适方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2866747/