Most voted "stringbuilder" questions
Stringbuilder is a class that provides a convenient and efficient way to work with text data. A variation is Stringbuffer.
Learn more…21 questions
Sort by count of
-
31
votes4
answers28968
viewsWhat is the most appropriate way to concatenate strings?
There are different methods for concatenating strings, such as Concatenating with the operator "abc" + str Formatting String.Format("abc{0}", str); Using the Stringbuilder new…
-
29
votes3
answers1131
viewsString and its efficiency
Doubt I would like to know what design patterns or other "nerdy" things have been applied to this class StringBuffer. Why does String create new objects in a concatenation? As far as I know, String…
-
13
votes1
answer718
viewsWhy should I use the Stringbuilder class instead of the String class?
Why these two classes are different, because it seems to me that they could be one class. For example, the method Append, it seems to me that he does the same thing as the operator +.…
-
4
votes4
answers313
viewsChanging a random string of characters using Stringbuilder
I have the following variables:: String mascara = "12****3*59**100*"; String numero = "12345768" There is a way to replace the asterisks of my variable mask by the values of my variable number?…
-
4
votes1
answer1398
viewsWhen to use String and Stringbuilder
There is another question about What is the most appropriate way to concatenate strings?. It explains the possible types of concatenations in C#. But when should we use System.String and when we…
-
3
votes1
answer551
viewsLoad txt file through a list c#
I make a query in the bank and put it in a list, then see each item of the list through the foreach to view other tables according to the Id of each row traveled. If found, I would like to upload a…
-
3
votes3
answers36
viewsString handling at alternate positions
I have an output that via EXPECT access an equipment and receive the data below: $result1 = " =============================================================================== Service Basic…
-
3
votes1
answer40
viewsStringbuilder append() converts to string automatically
Why when I use .AppendLine() it is necessary to convert the parameter to string, but when use .Append() conversion is not necessary?
-
2
votes4
answers311
viewsCreating Data Base through Stringbuilder
I am creating my database with the class sqliteOpenHelper, passing the creation of DB by String through the StringBuilder. The problem is, it’s just creating the first table, and then it doesn’t…
-
1
votes1
answer895
viewsDelete last line - Java
I’m reading a CSV using Bufferedreader by reading line by converting the result into a .txt. At the end of my txt is generating a line break after the last item. I’m trying to find a way to remove…
-
1
votes1
answer94
viewsWhy still use String instead of Stringbuilder in Java?
As many of you may already know, creating StringBuilder can greatly save the performance of our Java applications, as they are much faster than a String. This is due to the fact that the…
-
0
votes1
answer32
viewsTime Formatting
I am making an application that divided a String to write the same in time format. But if I put 102330 instead of returning me 10:23:30 it brings me 1:02:33 and if I put 112126 it formats correctly…
-
0
votes2
answers902
viewsHow to send form fields by email in a table format?
My application takes some data that the user fills in the Textbox fields (txtEmpresa, txtContato, etc...) and sends it to a preconfigured email. I can send the data via smtp, but they are being sent…
-
0
votes0
answers35
viewsOutofbounds Error
Good, I would ask you to help me with this mistake! This is part of a game code, the idea and print something like this M M M 123456789012345678901 1 2 M positions will vary with each move, Thank…
-
0
votes1
answer327
viewsNew Line Stringbuilder message Box C#
I would like to show in a messagebox the records with line break. but the result is this: I’d like you to stay line by line; My implementation is like this : When I’m debugging, no builder.append I…
-
0
votes1
answer45
viewsWrite a default value within a given cell in C#
I’m making a console application that reads data from a spreadsheet and compares it with values reported in the database. There is a default value, if a field of this worksheet is not filled in, I…
-
0
votes0
answers26
viewsHow to use ASP tags with Stringbuilder
People I am using Sringbuilder to assemble a page in ASP.NET jpa I did it several times without problems, but now I need to assemble a string that has tas ASP inside it, mount is not the problem but…
-
0
votes1
answer32
viewsNewline environement.Only works in the first line
Good afternoon. I am trying to generate a text file and it only works on the first line. From the second line, it gives you a space that you can’t solve. foreach (DadosSQL dados in listaDados){…
-
0
votes2
answers43
viewsWhy can’t I use Stringbuilder’s delete() method more than once in the same code block?
I’m trying to erase an interval of content from a StringBuilder, but when using the method delete() more than once the program gives error. Specifically, I’m trying to delete the pseudo-code part of…
-
0
votes1
answer70
viewsWrite to new column of a csv file using Stringbuilder c#
I saw an example of code right here in stackoverflow where I use the example below to write a CSV file using stringbuilder: public void ExportarCsv(List<Result> erros) { string filename =…
-
0
votes0
answers25
viewsRemove characters from a String (or generate a new one without them) that are between two special characters
I need some help in this case, I have a string and I would need to remove some characters from it. String minhaStr = "{"abcde{"fg":"hij"}" I need to remove everything between the keys {, ie in this…