filmov
tv
Why is StringBuilder efficient than string? - C# in-depth series (03)

Показать описание
In the C# programming guide, there is a paragraph saying the following in the article, "Programming with strings":
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Using stringBuilder for fast string creation -
String operations in .NET are highly optimized and in most cases don't significantly impact performance. However, in some scenarios such as tight loops that are executing many hundreds or thousands of times, string operations can affect performance. The StringBuilder class creates a string buffer that offers better performance if your program performs many string manipulations.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So, StringBuilder class creates better performance than string. But why? And how can it be more efficient? This video tells you the reasons.
C# in-depth series:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Using stringBuilder for fast string creation -
String operations in .NET are highly optimized and in most cases don't significantly impact performance. However, in some scenarios such as tight loops that are executing many hundreds or thousands of times, string operations can affect performance. The StringBuilder class creates a string buffer that offers better performance if your program performs many string manipulations.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So, StringBuilder class creates better performance than string. But why? And how can it be more efficient? This video tells you the reasons.
C# in-depth series: