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

what is LINE_WIDTH in the code below?

This code from effective java in Item 51: Beware the performance of string concatenation public String statement() { StringBuilder b = new StringBuilder(numItems() * LINE_WIDTH); for (int i = 0; i < numItems();…
das kinder
  • 1,160
  • 2
  • 9
  • 16
0
votes
1 answer

Adding Bullets to StringBuilder C#

I am using string builder to display error messages to my website. Is there a way to add bullet points to string builder? ul li..... Is string builder the best way to display multiple error messages? I can not use the validation summary it doesn't…
codeFinatic
  • 159
  • 1
  • 3
  • 17
0
votes
3 answers

Get all lines after the last print of line with 'keyword' in C#

I am working on a c# project. I am trying to send a logfile via email whenever application gets crashed. however logfile is a little bit larger in size. So I thought that i should include only a specific portion of logfile. For that I am trying to…
devlin31
  • 61
  • 7
0
votes
3 answers

Check if each letter in ArrayList is a certain character?

Firstly, I'm SUPER new to stackoverflow (so excuse my ugly formatting), and have only a few years of programming experience (about 6 programming classes total) I'm working on a hangman project. I've elected to use a StringBuilder for some of it. For…
Sergnio
  • 13
  • 2
0
votes
4 answers

Delete unwanted chars in a String Java

I'm trying to write a simple program that takes in a String as input. If the String matches a regex expression then it is returned. If not, I need to go through it, find each char that is causing the problem and remove it. The problem I'm running…
PT_C
  • 998
  • 2
  • 23
  • 48
0
votes
1 answer

creating multiple stringbuilders WTR to count

If i have a count say item =5. I want to generate 5 string builder objs. How can this be done? string[] features = UserBL.GetFeaturesByRole(Session["Role"].ToString().Trim()).TrimEnd(',').Split(','); in features i will have features. So according…
user2998990
  • 928
  • 2
  • 17
  • 35
0
votes
2 answers

Java new String and new StringBuilder in heap behavior

Does the String pool reside on the heap? If yes, are String literals eligible for garbage collection? When using new String("abc"), we know that it creates an object on the heap and places the String literal in the String pool. So my 2nd question…
Ryan
  • 127
  • 1
  • 16
0
votes
2 answers

A final class and underlying consequences in Java

I heard this line somewhere and I cannot get it off of my mind: "All members of a final class are implicitly final." Now, I know very well these three famous concepts: A final class cannot be extended. A final variable cannot be re-assigned with a…
0
votes
2 answers

Missing characters in string java

I'm trying to implement a java server with http frames, I have a couple of URI's : /login.jsp and /logout.jsp that are found in the Request URi of the http format. When I send the logout request to the Server I send it with a header like so:…
user3040942
  • 71
  • 1
  • 1
  • 4
0
votes
3 answers

C# Stringbuilder replace with a null value

Im trying to use Stringbuilder to build me a csv file and some of the fields from the files I'm using have double quotes in. I have this code as you can see I am trying to use the .replace to remove the " and replace with nothing, this throws an…
Greyhounddad
  • 113
  • 2
  • 9
0
votes
4 answers

Java while loop and prompt user

I have a user enter their social security number (fake number) and I need it in the format of 111-11-1111 including the dashes. If the user enters the information without the dashes, or goes over 999-99-9999, the program prompts the user to enter…
Nick Wilson
  • 47
  • 1
  • 9
0
votes
0 answers

VB.NET LINQ Query Runtime Multi-Table Join

I am using a StringBuilder to build a dynamic multi-table Join at runtime. I need to move the Join statement outside of the LINQ Query use a variable in it's place. Dim Results ' Object Type Results = From tbl1DataRow In dtTable1.AsEnumerable() …
80sRocker
  • 267
  • 2
  • 5
  • 17
0
votes
2 answers

StringBuilder cuts off after ~1500 Characters

im building a String with Stringbuilder, in the end i want to email this String, but it seems like the text always is cut off after ~1500 characters. List items = tableModel.getAllElements(); StringBuilder body = new…
0
votes
2 answers

Unable to parse sub items using JSON

I'm having a bit of trouble parsing formatting my json correctly and I was wondering if someone could show how to parse the data correctly in this instance: SOURCE: try { HttpURLConnection conn = (HttpURLConnection) new…
Guy Richards
  • 29
  • 3
  • 14
0
votes
1 answer

How to rennder a A tag inside a bulletlist Item Dynamically?

I have created a BulletList and i populate it dynamically using the following code. HtmlGenericControl Link = new HtmlGenericControl("a"); Link.Attributes["href"] = "/ProductDetail/tabid/85/rvdsfpsq/" + Convert.ToString(row["Manufacturer"]) +…
MarsOne
  • 2,035
  • 4
  • 25
  • 48
1 2 3
99
100