adspace
What is difference between string and stringbuilder in c#?
Answer Posted / Ravi Bhushan Mishra
In C#, String and StringBuilder are both used for handling text data, but they have some key differences. A String is an immutable reference type, meaning once it's created, its value cannot be changed. On the other hand, StringBuilder is a mutable class that allows changing of string values after creation. StringBuilder provides better performance when dealing with large amounts of dynamic text because it reuses memory for changes instead of creating new objects.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers