Top "Stringbuilder" questions

Stringbuilder is a class that provides a convenient and efficient way of working with text data in Java and .NET framework.

StringBuilder append() and null values

I have a list of Strings, and I want to concatenate them with spaces in between. So I'm using StringBuilder. …

java null append stringbuilder
Is it better to reuse a StringBuilder in a loop?

I've a performance related question regarding use of StringBuilder. In a very long loop I'm manipulating a StringBuilder and passing …

java performance string stringbuilder
Dumping a Java StringBuilder to File

What is the most efficient/elegant way to dump a StringBuilder to a text file? You can do: outputStream.write(…

java file stringbuilder
How to remove empty lines from a formatted string?

How to remove empty lines in a string in C#? I am generating some text files in C# (winforms) and …

c# regex string stringbuilder
How can we prepend strings with StringBuilder?

I know we can append strings using StringBuilder. Is there a way we can prepend strings (i.e. add strings …

c# java stringbuilder
Is String.Format as efficient as StringBuilder

Suppose I have a stringbuilder in C# that does this: StringBuilder sb = new StringBuilder(); string cat = "cat"; sb.Append("the ").…

c# vb.net performance stringbuilder string.format
Why does StringBuilder.AppendLine not add a new line with some strings?

I'm trying to use stringbuilder to create a body of string to be used in a text (not HTML) email. …

c# .net newline stringbuilder
StringBuilder: how to get the final String?

Someone told me that it's faster to concatenate strings with StringBuilder. I have changed my code but I do not …

c# string stringbuilder
String.Join vs. StringBuilder: which is faster?

In a previous question about formatting a double[][] to CSV format, it was suggested that using StringBuilder would be faster …

.net performance string stringbuilder
StringBuilder and byte conversion

I have the following code: StringBuilder data = new StringBuilder(); for (int i = 0; i < bytes1; i++) { data.Append("a"); } byte[] …

c# encoding byte stringbuilder