in C Sharp by
Explain String Builder class in C#?

► Click here to show 1 Answer

0 votes
This will represent the mutable string of characters and this class cannot be inherited. It allows us to Insert, Remove, Append and Replace the characters. “ToString()” method can be used for the final string obtained from StringBuilder. For example,

StringBuilder TestBuilder = new StringBuilder("Hello");

TestBuilder.Remove(2, 3); // result - "He"

TestBuilder.Insert(2, "lp"); // result - "Help"

TestBuilder.Replace('l', 'a'); // result - "Heap"
Learn More with Madanswer

Related questions

+1 vote
asked Jan 20, 2020 in C Sharp by AdilsonLima