Most of the posts in this blog are based on real time issues and scenarios. The main goal here is to share userful information and help many people out there. These information are really used and working. Please share any information you have while reading this blog.
Tuesday, April 30, 2013
Reuse a StringBuilder object after clearing the TEXT - Simplest way - in older .net frameworks..
StringBuilder doesn't have a Clear() to clear the text for .net framework 2.0. There are different ways to clear the text, which are following:
1. Use Remove() method and give full length of text to remove.
2. Use Replace() method and replace the characters with "".
3. And the EASIEST SOLUTION is just set the builder.length = 0;
No comments:
Post a Comment