Oct 18, 2019 in C Sharp (C#)
Q: Explain String Builder class in C#?

1 Answer

Oct 18, 2019
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"
Click here to read more about C Sharp
Click here to read more about Insurance

Related questions

Jan 20 in C Sharp (C#)
Feb 16 in C Sharp (C#)
May 24, 2019 in JAVA