NET - Explain when should we use StringBuilder class instead of the String class

Explain when should we use StringBuilder class instead of the String class.

Whenever any of the methods of String class is used to modify the string, a new object is created and memory is allocated to that object. If there are repeated modifications on the string, the performance can get hampered making it costly. Whereas, the StringBuilder class can be used for modifications over and over again without creating a new object. So one situation where a StringBuilder class might be of use is, if we are manipulation string in a loop.
NET - Explain why we should close and dispose resources in a Finally block instead of Catch block
Explain why we should close and dispose resources in a Finally block instead of Catch block - Catch block gets called only when an exception occurs or is explicitly thrown.......
NET - What is an Interface in NET?
What is an Interface in NET? - Interface contains only the declaration for its abstract members (events, methods, properties)......
NET - Define most commonly used interfaces in Net Framework
Define most commonly used interfaces in .Net Framework - IComparable, IDisposable, IConvertible, ICloneable, IEquatable, IFormattable......
Post your comment