By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,467 Members | 1,605 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,467 IT Pros & Developers. It's quick & easy.

How to clean the content of a strinbuider object

P: n/a
Hello,

I try to delete the content of a StringBuider object.
Is it Remove the only option?

private StringBuider secName = new .....;
......
secName.Remove(0, secName.Length);

Thanks
May 16 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi,

Yes, it's
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Dan Aldean" <da*******@yahoo.com> wrote in message
news:Ol**************@TK2MSFTNGP05.phx.gbl...
Hello,

I try to delete the content of a StringBuider object.
Is it Remove the only option?

private StringBuider secName = new .....;
.....
secName.Remove(0, secName.Length);

Thanks

May 16 '06 #2

P: n/a
thanks
May 16 '06 #3

P: n/a
Actually, that's not true.

A much easier (and cleaner, IMO) way of doing this is just setting the
Length property to 0.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:Os**************@TK2MSFTNGP03.phx.gbl...
Hi,

Yes, it's
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Dan Aldean" <da*******@yahoo.com> wrote in message
news:Ol**************@TK2MSFTNGP05.phx.gbl...
Hello,

I try to delete the content of a StringBuider object.
Is it Remove the only option?

private StringBuider secName = new .....;
.....
secName.Remove(0, secName.Length);

Thanks


May 16 '06 #4

P: n/a
much easier, much better
May 16 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.