Questions tagged [stringbuilder]

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

Stringbuilder is a class that provides a convenient and efficient way of working with text data. Implementation of the stringbuilder can be found in .NET framework and Java.

The very idea of the class is being a character array with the capability to insert and append new characters. It avoids copying the strings in the memory, hence improves the performance.

1966 questions
0
votes
1 answer

JAVA Appending stringbuilder to textarea, not replacing textarea just adding to it (need to replace instead of adding)

I have a stringbuilder to load up some lists of strings, my problem is when I add to the textarea I want to replace what was there and not just add to it.. I'm posting all of my code which is a lot so I'll further explain if anyone needs additional…
0
votes
1 answer

Get text to be bold

I have a function that creates a PDF with iTextSharp, It will get each date in the datagridview, with the associated data that is connected to it, and put it in a PDF. However, you cannot see that the dates are supposed to be headers, so my question…
0
votes
1 answer

how to create properties with sub properties having constant values in a class using c#

I would like to create a string using the StringBuilder() class. I have a collection of records of say Employees. Each record of Employee has columns such as firstName, lastName, city, etc. The string that I want to create will have the values of…
Akshatha
  • 478
  • 1
  • 9
  • 22
0
votes
1 answer

StringBuilder Equals in c# and Java

I have just come across this StringBuilder .equals Java, where java StringBuilder does not have Equals() implementation. However, in c# I observed there is an Equals() implementation available for StringBuilder class. I would particularly want to…
Darey
  • 447
  • 4
  • 23
0
votes
1 answer

Using Stringbuilder to set a filter for a datasource

If I set the filter writing the filter directly like myBindingSource.Filter = "Team = 'TheAvangers'" it works fine. But I want to set the string with stringbuilder like Dim sB as New StringBuilder sb.append("""Team =…
ruedi
  • 4,417
  • 11
  • 41
  • 73
0
votes
3 answers

Return a string in a while loop

Here, I want to avoid using the line return ""; and instead return all of the values I output with System.out.println(); I have tried using a StringBuilder method, but this outputs nothing when I run my test program. I am guessing that StringBuilder…
user4224913
0
votes
2 answers

C++ equivalent of java StringBuilder.replace

What is the C++ equivalent of the following java function? public StringBuilder replace(int start, int end, String…
Kamil
  • 699
  • 7
  • 16
0
votes
2 answers

Java - Looping and StringBuilders

I Have run into a brickwall and I'm not sure how to continue. Quick Rundown: My code is suppose to turn 4 Strings of Hexadecimals(ramError1-4) to Binary, manually. I Want to be able to loop 4 times and each time create a unique StringBuilder to…
vmina
  • 13
  • 5
0
votes
1 answer

How can I print data on more than one excel worksheet in C#

I have a C# application for creating an excel. The code is given below, public void CreateExcelSheet() { StringBuilder sbWriteBuffer = new StringBuilder(); sbWriteBuffer.Append("
Sudha
  • 2,008
  • 6
  • 25
  • 53
0
votes
1 answer

Splitting a toString from a SuperClass

I have a class toString: @Override public String toString() { StringBuilder animalString = new StringBuilder(); return animalString.append("Animal [breed=").append(breed).append(", weight in…
Wulf
  • 19
  • 1
  • 5
0
votes
1 answer

Need support to generate a word document using StringBuilder

I'm trying to generate a word document using StringBuilder, as follows [WebMethod] public static void ExportToWord(string HTMLContent) { HttpContext.Current.Response.Clear(); HttpContext.Current.Response.Charset = ""; …
vallabha
  • 355
  • 1
  • 12
0
votes
1 answer

why Syntax error: missing ) in JSON string built with StringBuilder

my string builder to create JSON Reply : List aList = getList(); StringBuilder StrBuilder = new StringBuilder(); StrBuilder.Append("\"length\":\""); StrBuilder.Append(aList.Count.ToString()); int i = 1; foreach (string str in aList) { …
Silvia
  • 95
  • 1
  • 2
  • 9
0
votes
2 answers

Operation on String

I have a String as "United Kingdom (UK), United States Of America (USA), India (IND)" I just want values which are in brackets i.e. I want a string "UK,USA,IND" .I am new to java . Please tell me how should I do this
Dhiraj_N
  • 51
  • 1
  • 2
  • 8
0
votes
1 answer

Splitting a string at certain differing character counts

I have a semi-complicated file full of lines. These lines can fall under one of two formats: Person Company The specification for a company line is like so: 10 Characters = company identification, record specification and status of company 22…
Wolfish
  • 902
  • 1
  • 7
  • 30
0
votes
1 answer

C# how do I make string from array of string?

Can you tell me an easy way to make a string from array of string? I have: String line = "how are you"; string[] split = line.Split(new Char[] { ' ' }); //{"how", "are", "you"} How i can make back "String - How are you"? IT IS ONLY EXAMPLE, NOT…
user4132485
1 2 3
99
100