StringBuilder sb = new StringBuilder();
sb.Append("Hello"); sb.Append("World");
4. Replace text in the StringBuilder:
5. Convert the StringBuilder to a string:string result = sb.ToString(); ``` These examples demonstrate how to use StringBuilder to build and manipulate strings efficiently. The package library for StringBuilder is the System.Text namespace, which is part of the .NET Framework.