Hello all ... i have a StringBuilder question. Im wondering the best way
to go about "clearing" a StringBuilder after is has aready been appended to.
heres the deal ... i have a textBox that i regurgitate ASCII information onto
from a StreamReader. This textBox is on a form, and on this form i have a
"Clear" button that essentially clears the textBox ...
Code:
StringBuilder buffer = new StringBuilder();
private void buttonClear_Click(object sender, EventArgs e)
{
outputFileTextBox.Text = "";
}
So ... if i want to clear the StringBuilder's "buffer" that already has "x"
amount of bytes "appened" to it, and clear the textBox at the same time ... would this
be the worst/best way to do to do it ... or would there be a better way, other then
allocating another builder for the next read?
Code:
StringBuilder buffer = new StringBuilder();
private void buttonClear_Click(object sender, EventArgs e)
{
outputFileTextBox.Text = "";
buffer = new StringBuilder();
}
Any info would be great !