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.

2114 questions
0
votes
1 answer

StringBuilder and Radiobuttonlist

I am using stringbuilder to create a radiobuttonlist dynamically for a survey I am working on. The code validates fine but will not render in HTML. Is this because I am not supposed to use stringbuilder to generate asp web controls? code…
Neil Norris
  • 411
  • 6
  • 16
0
votes
4 answers

To Reduce a String

I was solving a problem to reduce the form to it's non-reducible form. This was the question. Shil has a string S , consisting of N lowercase English letters. In one operation, he can delete any pair of adjacent letters with same value. For…
john400
  • 392
  • 4
  • 10
  • 20
0
votes
3 answers

Android HttpurlConnection read data using BufferedReader but get null value after append it to a StringBuilder

I got data from reader.readLine(). But it doesn't enter the while loop. The return 'json' string is null. Someone please help me to solve the issue. i have already tried a lot for a correct solution. try { URL urL = new URL(url); …
0
votes
1 answer

Prevent Reader (OpenXMLReader SAX) Breaking String Chunk every 1026 Chars

I am using some great code taken from StackOverflow and converted to VB NET to: Extract all rows of text from all speadsheets in an excel .xlsx file Append each row to a StringBuilder. The code runs really well, but my stringbuilder entries are…
GoodJuJu
  • 1,296
  • 2
  • 16
  • 37
0
votes
1 answer

StringBuilder AppendFormat throws IndexOutOfRangeException

I have a template define in a string: public static string EntityClassBegginingTemplate = @"using System.Collections.Generic; //generated by the RuleDesigner public abstract class {0}Base : {1} {"; And then I'm trying it to format…
Emilia Tyl
  • 565
  • 1
  • 5
  • 17
0
votes
1 answer

Powershell: String is added more than once to another string

In a script that builds a blob of text, there is a point where a block of "summary" text can be prepended to said blob. Although the script only generates the summary text once, it gets prepended to the text blob multiple times. This is the…
0
votes
2 answers

Efficiency of StringBuiler

I noticed there's a performance difference between these two styles of using StringBuilder: StringBuilder text = new StringBuilder(); // style 1 text.append("a" + "b"); // style 2 text.append("a").append("b"); It seems the more data text append,…
edhu
  • 449
  • 6
  • 23
0
votes
0 answers

Position in string builder

I have a class CustomBuffer that implements Appendable, CharSequence and extends Buffer. It uses a charBuffer to access elements. Since it takes some time in computation I am planning to replace it with a StringBuilder. Unfortunately my current…
yellow
  • 425
  • 7
  • 20
0
votes
1 answer

ORA-00936: missing expression while using stringbuilder

I am using StringBuilder to use multiple queries in asp.net. But I am getting error as ORA-00936: missing expression Below is my query. StringBuilder sb = new StringBuilder(); if (ddlProject.SelectedValue != "0" && ddlBuilding.SelectedValue !=…
Nad
  • 4,605
  • 11
  • 71
  • 160
0
votes
1 answer

Difference between StreamWriter's NewLine and StringBuilder's newline?

I am converting picture files into base64 Strings in order to store them in a .txt file and later retrieve them and re-convert them into images. In doing so, I discovered a funny misbehaviour on behalf of my StringBuilder: // **Example A, uses…
HerrMetik
  • 63
  • 1
  • 7
0
votes
2 answers

how to apply CSSClass & style in while create asp button using StringBuilder in c#

My Code is below which is not working for applied css for created control at client side when applying it, my css class is : img-rounded string strClass = "img-rounded", strColor="Green"; StringBuilder sb = new…
0
votes
2 answers

Overloaded StringBuilder insert() and Difference Between offset and index

I am just wondering if there is any difference between the semantics of offset and index when indicating the location where we can insert the specified argument (be it of type String, Object, char[], etc). For example, all of the two-argument…
soti84
  • 83
  • 1
  • 10
0
votes
0 answers

Getting exception on PostUrlBuilder when build post URL for Volley Custom post request with array parameter with normal param

I am trying to build a post URL for Volley custom request to post some data to server using post method with normal param and array param. But I get some exception when build the post url for request. I am getting exception before make a request…
Rifan
  • 424
  • 6
  • 17
0
votes
3 answers

StringBuilder AppendFormat IEnumarble

I have a string builder and a list of object , int[] values = new int[] {1,2}; StringBuilder builder = new StringBuilder(); builder.AppendFormat("{0}, {1}", values ); I see an IntelliSense error None existing arguments in format string why am I…
Shachaf.Gortler
  • 5,655
  • 14
  • 43
  • 71
0
votes
1 answer

stringbuilder as out parameter

extern "C" __declspec(dllexport) bool FillString(LPWSTR OutName) { LPWSTR out = L"TheName\0"; int len = wcslen(out); memcpy( OutName, out, len * sizeof(wchar_t)); return true; } That…
TEDSON
  • 191
  • 2
  • 13